1. Duplicate the AnimationObjects group.
2. Name it Rock Group.
3. Delete all but the Rock inside it.
4. Agree to losing the prefab.
5. In the original AnimationObjects group, deactivate the Rock. Deactivate retains the prefab in case it has to be updated at some point.
Hiding the Cursor
With re-picks managed, it’s time to think about hiding the cursor after a valid pick. At first, you might think the answer will be to hook up the cursor hide/show to the processing flag. Testing on the flower, with its rather long animation, would soon make you realize that hiding the cursor for the duration of the picked object’s animation will be frustrating. Even with the rock, the player will want to be able to pick the key as soon as she sees it.
Not hiding the cursor at all after a valid pick visually interferes with the “reward” of seeing a reaction, so that is not the answer either. Ideally, you will want to hide it for an amount of time independent of the animations. To do that, you can set up a timer.
1. Open the GameManager script.
2. Add the following variable:
3. In the OnGUI function, change the if(!navigating) line to:
4. Save the script.
5. Open the Interactor script.
6. In the ProcessObject function, beneath the processing = true line, add the line that turns on the suppressPointer flag:
7. Save the script.
8. Click Play and pick any of the action objects.
The cursor is turned off as soon as you pick an object. And stays off…
Now you will have to turn it on, after a given amount of time. The problem is where and when. If you wait until after the animation has finished, the player may become frustrated during the wait, if she wants to pick another object. If you add it in earlier with a pause, it will delay all of the rest of the actions. A better solution is to create a timer.