The home stretch

For the final part of this chapter, we will set up our PlaceSkeeBallMachine class, which will allow us to airtap the collider of the Skeeball machine. It will then move with our view until we find a good spot for it; airtap again and everything start from the beginning.

I have included a copy of the PlaceSkeeBallMachine script file in the Chapter6Downloads.Zip file. This is a heavily modified version of the TapToPlace script that comes with the HoloToolkit. Of course, as usual I recommend that you type it out. Now, let me add you do not have to type all the comments unless you want to. I recommend that you put in comments that help you keep up with how it works, in your head. Normally, comments are designed for people who already know how to write code, not people learning to code. Jargon, while useful for the future, can take some time wrapping your head around, and therefore it slows down the learning process. Word it how it makes sense to you.

Now, we will attach the script file to the appropriate object and set it up:

  1. Expand the skee object and locate the TapToPlaceCollider. Select it to see it in the Inspector:
  1. Select the PlaceSkeeBallMachine.cs file in the Assets view, drag it to the TaptoPlaceCollider object, and drop it:
  1. Select the skee object in the Hierarchy view, and without releasing the mouse button, drag it to the Parent Game Object Tap field. Then, select the Place Parent On Tap box:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.244.216