attachTo: Difference between revisions
Jump to navigation
Jump to search
(added note) |
(mass edit: removing obsolete </dt> and </dd> tags) |
||
Line 35: | Line 35: | ||
<dl class="command_description"> | <dl class="command_description"> | ||
<!-- Note Section BEGIN --> | <!-- Note Section BEGIN --> | ||
<dd class="notedate">Posted on June 6, 2009 - 13:47 | <dd class="notedate">Posted on June 6, 2009 - 13:47 | ||
<dt class="note">'''[[User:IceShade|IceShade]]''' | <dt class="note">'''[[User:IceShade|IceShade]]'''<dd class="note">You can use <i>setDir</i> to change the direction of the attached object. The direction is relative to the object you attach it to, so <i>setDir 180</i> won't point to the south but to the rear of the object you attach it to. | ||
Use <i>setPos</i> to synchronize the direction of the object in a network game. | Use <i>setPos</i> to synchronize the direction of the object in a network game. | ||
Line 43: | Line 43: | ||
<code> | <code> | ||
Object setDir 180; | Object setDir 180; | ||
Object setpos getpos Object;</code | Object setpos getpos Object;</code> | ||
<dd class="notedate">Posted on September 17, 2011 - 19:20 | <dd class="notedate">Posted on September 17, 2011 - 19:20 | ||
<dt class="note">'''[[User:TeaCup|teaCup]]''' | <dt class="note">'''[[User:TeaCup|teaCup]]'''<dd class="note"> | ||
Some objects you cannot attach anything to. To be more precise, you can attach objects to them, but the behaviour is unexpected. For instance: <code> | Some objects you cannot attach anything to. To be more precise, you can attach objects to them, but the behaviour is unexpected. For instance: <code> | ||
SuitcaseObject attachTo [FoldingTableObject, [0,0,0]];</code> | SuitcaseObject attachTo [FoldingTableObject, [0,0,0]];</code> | ||
Line 53: | Line 53: | ||
Dodgy objects when it comes to attaching things to them: most in Objects(small), Objects(signs), all of Objects(helpers) categories, etc.. | Dodgy objects when it comes to attaching things to them: most in Objects(small), Objects(signs), all of Objects(helpers) categories, etc.. | ||
<!-- Note Section END --> | <!-- Note Section END --> |
Revision as of 16:49, 17 October 2011
Description
- Description:
- Attaches an object to another object. The offset is applied to the object center unless a memory point is provided.
- Multiplayer:
- Only has to be executed on one client.
- Groups:
- Uncategorised
Syntax
- Syntax:
- Object attachTo [TObject, Offset, MemPoint]
- Parameters:
- Object: Object or player
- TObject: Object or player
- Offset: Array - format Position - (optional)
- MemPoint: String - (optional)
- Return Value:
- Nothing
Examples
- Example 1:
player attachTo [car,[0,0,1]];
- Example 2:
player attachTo [tank,[0,-1,0],"Usti hlavne"];
- Example 3:
ammoCrate attachTo [player];
Additional Information
- See also:
- detach
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Notes
- Posted on June 6, 2009 - 13:47
- IceShade
- You can use setDir to change the direction of the attached object. The direction is relative to the object you attach it to, so setDir 180 won't point to the south but to the rear of the object you attach it to.
Use setPos to synchronize the direction of the object in a network game.
Example code:
Object setDir 180; Object setpos getpos Object;
- Posted on September 17, 2011 - 19:20
- teaCup
-
Some objects you cannot attach anything to. To be more precise, you can attach objects to them, but the behaviour is unexpected. For instance:
SuitcaseObject attachTo [FoldingTableObject, [0,0,0]];
You would expect the suitcase to jump to the pivot point of the table, and stick to it. Instead, the suitcase will freeze in it's original position. Even if the table is moved, the suitcase will be unaffected: it will not follow the table, it will not even respond to actions it reacted to prior to being attached: pushing, being shot at, etc.. It's just an object frozen in space. In MP it's even weirder, the suitcase would turn invisible. Dodgy objects when it comes to attaching things to them: most in Objects(small), Objects(signs), all of Objects(helpers) categories, etc..