Lab
9
Using movers and the ygScene node
Start yg and load
lab8.yg.
1. Add a wandTrigger node to open the box
when button1 is pressed inside of the
box.
2. Create a moveToNode node
at the gun frame of reference and make the gun object its
child
3. Create a second timer node that will dynamically
set the moveToNode between 0 and 1 over
a duration
of 0.5 seconds
4. Create a second wandTrigger
above the moveToNode that will start the
mover timer when button1 is
pressed
5. Configure the scene to set
the volume of the second wandTrigger to
from point to sphere only after the box has
opened
What happens when you press button1 inside the second
trigger?
Why?
6. Setup the trigger to set the
node message of the moveToNode node
to the ygWand node that generated the
button1 event:
when->button1->moveToNode1.node($wand)
7. Save the scene as gun.yg
8. Delete the current scene and
load lab7.yg
9. Create a ygScene node and place it somewhere in the house
10. Use the file message to load the gun.yg scene
11. Open the case and grab the gun
12. Save the current scene as
lab8b.yg
13. Reload the gun.yg scene and setup a third wandTrigger node to allow you to
put the gun back inside the box when button1 is
pressed
Where do we have to be to put
the gun back in the box?