O'Reilly logo

Virtual Reality Blueprints by John Williamson, Charles Palmer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Update function

Statements in the Update () function are called in each frame that the scene is running. In our function, we are listening for input from the Player. If the Player clicks the left mouse button, or presses the A or X buttons on the Touch controller, the Shoot () function will run. Keep in mind that interaction with a button can have three stages. First, the Touch controller has sensors which detect when fingers are near a button. Second, a button can be pressed. Third, a button can be released. In each of these cases, we can trigger an event to coincide with player interaction.

So, the GetButtonDown call will be true for the Update frame while the button is being pressed. It will revert to false at the start of the next frame. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required