I'm a doctor, not a mechanic
This tutorial discusses attaching actors to a mover and assumes you already know about:
Any actors attached to a mover will follow the mover. You can attach smoke generators to leave a trail of smoke or attach a fighter jet decoration to fly around your map.
Attached actors can be anywhere in the map; they don't have to touch the mover or even be anywhere near it. The mover can be hidden (in solid space) and the actors will appear to move independently. Attached actors will always move relative to the movement of the mover; if the mover moves 64 units to the left, so will the attached actor.
Method 1: Attach Tag
To attach any actor to a mover, match these tags:
- The Mover's Events -> Tag
- The Actor's Movement -> AttachTag
Most actors can be attached in this way. There are three possible pitfalls however.
In order for this to work there must be only one actor (mover or otherwise) in the game with the same Tag as the actor's AttachTag. If the same tag is used by your mover and another object, the attached actor will not know which object to follow, and will not move. You will have to give your mover a unique tag before you can successfully attach other things to it in this way.
You will need to change this property for the actor you want to attach: see Actor Properties Window for how to edit hidden properties. However, this may cause problems in netplay. Another solution is to Create a subclass for the item you want to attach, and change the default value of bStatic for the new custom class.
Bizzarely, Collision.bCollideActors must be true for attachment to work, or the attached item may just drift off casually into the void in a straight line. (This was observed when attaching a rotating mover to the arm of another rotating mover. No other Collision flags appear to be needed.)
Method 2: AttachMovers (UT only)
This method is an alternative, available in UT and other games of that generation which have the AttachMover class. To add special movers, right-click the Add Mover toolbox button instead of just clicking it: choose "AttachMover" from the small pop-up menu.
An AttachMover has the same properties as a normal mover, you can have it BumpOpenTimed so it will open when you touch it, TriggerOpenTimed so you can trigger it (see Activating a mover for more on this). The only difference is that in the properties of the mover there is now a new option.
Unreal uses tags to tie actors to the AttachMover, the same way Triggers work. The same name must be present in two different places. It doesn't matter what the text is, but something descriptive may help later. 'Blah' will do, as will 'Attach' or 'AttachedBarrel'. The following properties must match:
- The AttachMover's AttachMover -> AttachTag
- The Actor's Events -> Tag
Now you may have to set a few other properties on the actor to get this to work. Check the actors have the following properties set:
- Advanced -> bMovable = True
- Advanced -> bStatic = False
Also, it is a good idea to turn the attached actor's collision off. If the actor has it's collision properties set to True, it can cause all sorts of problems (i.e. your actor may not move properly). If you need collision, try using an invisible mover to create the illusion of collision. Alternatively, in the case of Karma-simulated actors, collision can be manually disabled between two actors without affecting those object's collision with the remainder of objects in the world.
Now test your map. When the mover moves, the actor should move with it.
- If your actor does not move with the mover, check the bMovable and bStatic properties of the actor. Lights are one example.
- Do not attach any NavigationPoint or any actor that alters the bot's pathing to a mover.
- Do not attach an actor to more than one mover.
Actors that are attached to a mover follow its location, but only the yaw of its rotation. If you need to have your actors follow rotational movement around the other axes as well, check the ActorAttacher component.
You can try attaching a Kicker to a mover to make a triggered jump pad. Just add the kicker somewhere below the kicker where it won't effect players, then attach it to a mover which will move it up enough so that it kicks people. This can be quite fun for things like Human Cannons <insert evil laugh here>.
- Alternatively, see the Kicker actor page for a subclass which does this.
You can also attach a SkyZoneInfo to movers. I've tried this one and it's pretty cool. Try creating a circular SkyBox, then add a mover in the very center of it that rotates constantly. You will want to make sure that you can't see it at any point though :) After that, add your SkyZoneInfo somewhere near the perimeter of the skybox and attach it to the mover.
You will want to check that bDirectional = True in the advanced properties of it so that it is facing the correct way (say you are doing a flying ship or something :) ) Also, you can try tilting it sideways in towards the center of the skybox so that the entire map is sloped inwards as you would on a moterbike (This can make you feel sick after a while :) )
- Mover Topics
- Actor (UT)/Advanced properties
- Actor (UT)/Events properties
- Actor (UT)/Movement properties
- ActorAttacher component for UT
- Movable Lights making lights move