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...