TUTORIALS - UE3 MOVERS

Info

About : This tutorial will introduce the reader to the world of animated level geometry in UE3. Doors, elevators, and so on.

Target Audience : Unreal Engine 3 users - intermediate skill required

Platform : Unreal Engine 3 including RoboBlitz, GOW, and UT3

Last Update : Originally written in November 2006 - Updated in January 2008









A triggered object



This tutorial will explain the basics of animating meshes in the Unreal Engine 3. Those who have experience with previous Unreal Engines will notice that "movers" have changed quite a bit. They are much more powerful now and offer plenty of new possibilities. The new movers can have a lot of keys, much smoother movement and are easier to control. Setting up a mover however has become more complex. The controls for the mover are also hidden quite well in the matinee menu which is on its turn hidden in kismet, the visual scripting tool. This tutorial will also give a basic introduction to kismet as it is required to trigger the movers.

Movers can be anything. Doors, elevators, machines, and so on. For this tutorial we are going to make a moving plateau, call it an elevator if you want.

Create a basic cube or platform or just load up an existing map to start with.

The first thing you need to do now is to add the staticmesh you wish to animate as an interpolatingmesh. To do that select the desired mesh in the Generic Browser and while it is selected rightclick somewhere in the level and pick Add Actor -> Add InterpActor

After that add a trigger near or on top of it by rightclicking it again and choose Add actor -> Add trigger.

Next load up kismet (button with a green letter K - top toolbar) and make sure the trigger actor in the level is still selected. Rightclick somewhere in the Kismet window and select New Event Using Trigger_0 -> Touch.


Note that the way of triggering something is often dependent on the game you are editing. In case of RoboBlitz you will need to use a RTriggerVolume and not a regular trigger. Make the Triggervolume with your red builder brush and then add it to Kismet in a similar manner.


Rightclick somewhere again and now choose New Matinee. Connect the trigger Touched node to the Play node of matinee (click on a little black square next to a word and drag to connect the two).


Now select the interpolatingmesh in the level and while it is selected doubleclick the matinee node you just added in kismet. This will open the Matinee editor. Matinee is the sub editor for anything to with animated level geometry, cutscenes, cameras, and so on.

On the left side rightclick and choose New Group. The name for the group is irrelevant.

Update: In certain newer builds of the engine, namely UT3, you are required to rightclick in the lower panel to get to the New Group menu, instead of the left panel!


Next rightclick the group you just made and choose Add New Movement Track.


Because you had the elevator selected in your level it will automatically assign the movement track to it. Your elevator still doesn't move though. To add movement to it you must define its destination position. Add two location keys to the movement track. One at its start and one wherever else you want. Left click somewhere in the time bar at the bottom of the Matinee window and then add a key with the Add Key button in the top left.


One other important element in the matinee editor is the End line. The end of the timebar. You can click and drag the little orange triangle closer by or further off if you need more or less time.

Where the end is located is very important because UnrealEd does not stop once it went past the key you set. It will continue until it hits the End line. In other words: If your last key is on five seconds but the red line is at 15 seconds your elevator or door will open in five seconds and then pause for ten seconds until the End line is reached. In most situations you want to set the End line on the same location as the last key. You might think the End line is great to make the mover pause a while before it closes but there are better and more powerful ways of controlling the pause time. Therefore I prefer setting the End line around the last key.

After you set a second key be sure to leave the key selected and without doing anything else or closing anything at all go back to your level and move the elevator to its destination. Where you move it to will be remembered as its destination. Be sure to use the gizmo arrows to move the mesh, and not the shortcuts as a "feature" in certain builds may not register moves done with the shortcuts correctly.


You can preview the animation by pressing the play button in matinee.


You are now done with matinee. Close its window and go back to kismet. While your elevator already works now it could use some serious improvements. Right now it will only work once and it doesn't return to its start position once it has been opened. To address those issues you need to do some kismet scripting.
Connect the Completed output of the Matinee node back to its own Reverse input. This will cause the elevator to return once to ground level once it reached the upper level.

You might also want to pause the elevator when it is at it's top position. The best way of doing so is to add a Delay node to kismet. Rightclick and choose Action -> Misc -> Delay. You can configure the actual delay in its properties (click it and look at the bottom of the Kismet window)

Break the Finished - Reverse connection you previously made by holding Alt on the keyboard and clicking on either Reverse or Completed. Next connect the Matinee's Completed output to the Start input of the Delay node and connect the Finished output of it to the Reverse input of the Matinee node.


A last thing you need to check is if the Trigger is configured correctly. In Kismet click on the trigger node and check its properties. Make sure it has bEnabled True and MaxTriggerCount of 0! Zero stands for an infinitive number of retriggers.

Also note: a Matinee node can hold multiple movement tracks for multiple interpolatingmeshes. You don't need to make a new Matinee node for every piece of a complex mover as long as all pieces require the same amount of time/delay and trigger.


If your mover is not affected by lighting, you must open the properties of a nearby light, and enable the Dynamic channel in the LightingChannel section. Optionally you can also enable bCastCompositeShadow and bCastDynamicShadows to get dynamic shadows, although those might decrease performance.



(Picture from another tutorial)


Additionally, you can also enable the LightEnvironmentComponent, found in the properties of the InterpActor - DynamicSMActor - LightingEnvironment - LightEnvironmentComponent. The AmbientGlow properties in the section above it, lets you set the ambientcolor of the mesh.


You now have a basic but fully working elevator!




Elevators and doors in UT3


In UT3, a special Kismet Setup is available in for elevators. Select your Interpactor, and then go to Kismet and rightclick New Event - Physics - Mover.




This will create a predefined setup that does not require a trigger actor anymore. The player simply touching the interpactor itself, instead of the trigger actor, will now activate the interpactor.



Note how I added sounds to the elevator using Kismet actions, instead of the sound properties found within the properties of the Interpactor. This to gain greater control over how the sound is played, how loud, and when.



Doors in UT3 are a little bit bugged. If you were to simple set up a door with a single trigger, the door will sometimes either close too soon, or not at all. To my experience it helps adding a second trigger to the setup that acts as a backup for the first. The idea is to make the radius of the backup trigger far smaller than the main trigger, and to disable the backup trigger whenever the main trigger is activated. If however, the main trigger would become untriggered and there would still be a player inside its radius, the backup trigger would pop into action when the player would run into the much smaller second trigger, which in turn will kick the door into action. I haven't heard people complaining about the doors in my levels yet, so this might actually work.



The triggervolume is the backup trigger and is a very narrow volume real close to the door it is suppose to open. The gates prevent it from sending out any command as long as the regular trigger is active. The backup trigger must be disabled when the regular trigger is active to prevent players from triggering the door twice using two different triggers.




A continuously looping animation


Making a looping animation isn't very hard at all and can be great In he first and second Unreal Engine you had a special Loopmover class, forget that. In Unreal Engine 3 you use a regular Interpactor with some smart Kismet scripting.

Set your interpactor up the regular way. That means add the actor to the level, make a Matinee node in Kismet and give the element a movement track in it. After that return to Kismet and instead of adding a Trigger Event to it rightclick and New Event -> Level Startup. This kind of event will obviously force something to trigger as soon as the level starts up.

Next connect the Level Startup node to the Play input of the Matinee. Connect the Matinee's Completed output node to its own Reverse node and then connect the Matinee's Aborted output node to its own Play input node again.


This will cause the animation to reverse itself to its first position once it reached its final key frame and restart itself once it was completely reversed. That last behavior is controlled by the very illogically named Aborted output node.

Another way to create a looping animation is by simply enabling the bLooping property found in the Matinee node in Kismet. Both approaches will get you roughly the same result.




A continuously rotating animation


If you want to continuously rotate something, like the wheel of a machine, a wind mill and so on, you are not even required to use Kismet.

Simply place a mesh as an Interp actor in a level, and open up its properties (F4). Expand the section Movement and go to the sub section RotationRate. Set a number to any of the axis. This is the amount of rotation the mesh will make per second, a higher number means a higher speed.

Next, return to the main Movement section, and change the property Physics from the default PHYS_Interpolating to PHYS_Rotating.

That's it!




Attaching something to a mover


Place two Interp actors, and open up the properties of the Interp actor you wish to attach to the other one (so select the child mover). Expand the section Attachment, and type in the name of the other mover in the property Base. If the other mover is named InterpActor_47, retype that name in the Base property. The name of the selected actor is always displayed at the titlebar of the properties window.

Done!