Interrupting An Animation

From OpenUru
Jump to: navigation, search

This tutorial will introduce you to making an animated object stop it's animation, and reverse it, without it starting over at the beginning. It assumes that you already know how to make an animated object.

If you link in to Gahreesen, you will remember how in the power room, we had to step on a plate to make a cylinder rise up, and if we stepped off the plate, the cylinder would begin to lower. We are going to re-create that same effect here.

A Video version of this tutorial can be watched here.

The Objects

If you look at the picture below, you will see that I have a blue cylinder. It's about 10 feet high, but I have it sunk into the ground to where it just peeks out. The cylinder also has a animation, in that it will raise up to almost it's full height in 10 seconds (300 frames).

Stopndrop1.jpg

The other objects that I have, is a small plane, close to the ground. It will represent the "plate" that the avatar steps on. We also have 2 sensor regions here, one right on top of the other one.

Stopndrop2.jpg

Select one of the boxes that is going to be a region sensor, and apply that component on it. In the roll out for it, make sure you put a check mark under "Trigger On Exiting Volume" only. We want this region sensor to only trigger when you leave it:

Stopndrop3.jpg

Next, select the other box and make it a region sensor to, but make sure you put a 2nd region sensor component on it. In it's roll out, make sure you put a check mark under "Trigger On Entering Volume" only. We want this region sensor to trigger only when we enter it, but not when we leave it:

Stopndrop4.jpg

Now open up the Component Manager and create 3 logic responders. Name them in a way that makes sense to you. I have my labeled so that one is the "Starting" responder, one stops the animation and makes it drop, and one stops the animation and makes it rise:

Stopndrop5.jpg

You can attach these responders to what ever object you like. I have mine all attached to one of my regions sensors so I can see them all.

Select the responder that is going to be your "Starter" responder. Make the detector your region sensor that triggers on "Enter" only. Give it the following commands: Set Animation Forward, Play Animation, and Enable Responder. The animation is of course our cylinder. We are going to use the "Enable Responder" command to turn of this very responder however as you can see in my picture below:

Stopndrop6.jpg

Why did we do that? Because we do not want this responder to be "on" anymore after it is first triggered. Instead, another responder will take over. Think of it like the starter motor on a car, once you get the engine cranked, you do not want the starter to still be running.

Now select the responder that is your Stop and Drop one. The detector for it needs to be the sensor region that triggers on Exit only. Give it 4 commands: Stop Animation, Set Animation Backwards, Play Animation, and Enable Responder.

Stopndrop7.jpg

The animation commands are all for the cylinder of course. The Enable Responder needs to turn on the 3rd responder, our Stop and Raise responder as shown in my picture above.

Now select the 3rd and last responder. It's detector needs to be the region sensor that triggers on Enter only. Give it 3 commands: Stop Animation, Set Animation Forwards, Play Animation:

Stopndrop8.jpg

As you can see from my picture above, I have removed the check mark where it says "Enable". This will have the responder start off as "Off" until it is turned on by the 2nd responder.

That's all you need to do for this. Of course there is texturing and adding sounds, etc. However you can now export and give it a try. Here is a video of how it looks:

Stop and Drop Video



Return To: 3DS Max Plugin Tutorials

Copyright (C) 2011 Andy Legate.
heckert_gnu_62x60.png
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU Free Documentation License".