2011

Before using this script, lets create a second script to close the door.
10 Click Add New Script
renaming this, Close Door.
11 In the Events section, click On Hotspot .
12 In the Properties section, click Pick and click the center of the door.
13 Change the Radius (m) value to 2.
14 Change Trigger When from Entering to Leaving.
15 In the Actions section, click Play Animation .
16 In the Properties section, click the Animation drop-down, expand Scene 1 and select the Internal Door
animation.
17 Change Starting At from Start to Current Position.
18 Change Ending At from End to Start.
Youre now ready to try your scripts and interact with your animation.
19 Walk backwards away from the door (until youre more than 2 meters away).
20 Click Animation tab Script panel Enable Scripts
, and then walk towards the door.
When you walk within 2 meters of the door, the event will be triggered and the door will open. If you then
walk backwards (or through the door), when you are more than 2 meters away (leaving the hotspot sphere),
the leaving event will be triggered, playing the animation in reverse, and the door will close.
NOTE When scripts are enabled, the Animator and Scripter windows will be disabled so that they cannot be
modified while running. Once you are finished using the scripts, or if you need to edit/add animations or scripts,
remember to click Enable Scripts again, turning them off.
Animation Interaction | 25