| Home Page | Recent Changes | Preferences

Attaching Actors

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.

Non-unique Tag

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.

bStatic

Most actors can be attached in this way. The principal cause of an actor not moving with the mover is that it has the property bStatic set to true by default (for example PlayerStarts and Volumes).

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.

bCollideActors

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.

Attaching Actors

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.

Warnings

  • 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.

Ideas

Triggered Kicker

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.

Moving Skybox

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 :) )

Related Topics

Comments

Foxpaw: Can this be renamed, since it deals only with attaching things to movers, and not attaching things to bones, or just using plain old attach or setbase?

Tarquin: "Attaching to movers"?

Foxpaw: That could work. Alternatively we could add stuff on those other topics here, though admittedly I've never had any success with the "Attach" function and only sporadic results with Setbase.

MythOpus: I suggest making a base page called Attaching or something and have subpages for attaching actors to movers and bones etc...

~~ Sounds good :)

~~ Thanks :) I think I'll get right no it then. Can you rename this page to Attaching_To_Movers or something? And do you want it to be a sub-page of " Attaching_Stuff " or just a page on it's own?

GTD-Carthage: I've done everything correctly but no matter what happens, BlockPlayer actors don't move with the attachmover. I've tied up everything correctly and even investigated twice. Are BlockPlayer actors really just static actors?

Ragdoll: I dont know about other games, but in Devastation if you try to change bStatic to false to attach an actor you will get a violent crash when played online. You even get a message in the map check errors box saying "actor X is bStatic=False, but is bStatic by default, map will fail in netplay".


Category Mapping
Category To Do this tute has only been partially freshed up for UT2003.

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In