attachTo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(setDir and attachTo)
m (Added Note syntax)
Line 34: Line 34:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
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.
<dd class="notedate">Posted on June 6, 2009 - 13:47</dd>
<dt class="note">'''[[User:IceShade|IceShade]]'''</dt><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 41: Line 42:
<code>
<code>
Object setDir 180;
Object setDir 180;
Object setpos getpos Object;</code>
Object setpos getpos Object;</code></dd>
 
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 15:47, 6 June 2009

Hover & click on the images for description

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
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"]; 

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;

Bottom Section