attachTo: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "{{Inline code|" to "{{ic|") |
Lou Montana (talk | contribs) m (Text replacement - " <dd class="notedate">" to " <dt><dt> <dd class="notedate">") |
||
Line 57: | Line 57: | ||
<dl class="command_description"> | <dl class="command_description"> | ||
<!-- Note Section BEGIN --> | <!-- Note Section BEGIN --> | ||
<dt><dt> | |||
<dd class="notedate">Posted on September 17, 2011 - 19:20</dd> | <dd class="notedate">Posted on September 17, 2011 - 19:20</dd> | ||
<dt class="note">[[User:TeaCup|teaCup]]</dt> | <dt class="note">[[User:TeaCup|teaCup]]</dt> | ||
Line 65: | Line 65: | ||
Instead, the suitcase will freeze in it is 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 is even weirder, the suitcase would turn invisible.<br> | Instead, the suitcase will freeze in it is 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 is even weirder, the suitcase would turn invisible.<br> | ||
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. | ||
<dt><dt> | |||
<dd class="notedate">Posted on March 28, 2014 - 16:22</dd> | <dd class="notedate">Posted on March 28, 2014 - 16:22</dd> | ||
<dt class="note">[[User:Pixinger77|Pixinger77]]</dt> | <dt class="note">[[User:Pixinger77|Pixinger77]]</dt> | ||
Line 79: | Line 79: | ||
_charge [[setDamage]] 1; | _charge [[setDamage]] 1; | ||
</code> | </code> | ||
<dt><dt> | |||
<dd class="notedate">Posted on 1 Jun, 2014 - 2300</dd> | <dd class="notedate">Posted on 1 Jun, 2014 - 2300</dd> | ||
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]</dt> | <dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]</dt> | ||
Line 89: | Line 89: | ||
_obj [[attachTo]] [_anotherOne, [0, 0, 0]]; {{cc|vector changes to default}} | _obj [[attachTo]] [_anotherOne, [0, 0, 0]]; {{cc|vector changes to default}} | ||
</code> | </code> | ||
<dt><dt> | |||
<dd class="notedate">Posted on September 25, 2014 - 10:00</dd> | <dd class="notedate">Posted on September 25, 2014 - 10:00</dd> | ||
<dt class="note">[[User:ondrejkuzel|ondrejkuzel]]</dt> | <dt class="note">[[User:ondrejkuzel|ondrejkuzel]]</dt> | ||
<dd class="note"> | <dd class="note"> | ||
Attaching an object does not update the accessibility of a place for the AI. The command '''should not''' be used for positioning large static objects - the AI will simply walk through such objects. | Attaching an object does not update the accessibility of a place for the AI. The command '''should not''' be used for positioning large static objects - the AI will simply walk through such objects. | ||
<dt><dt> | |||
<dd class="notedate">Posted on September 1, 2016 - 17:54 (UTC)</dd> | <dd class="notedate">Posted on September 1, 2016 - 17:54 (UTC)</dd> | ||
<dt class="note">[[User:Demellion|Demellion]]</dt> | <dt class="note">[[User:Demellion|Demellion]]</dt> | ||
Line 102: | Line 102: | ||
Vehicles may start flipping with no mass calculation (ie tank might fly), player object might gain infinite Z-vector velocity on any interaction with terrain relief and other objects. | Vehicles may start flipping with no mass calculation (ie tank might fly), player object might gain infinite Z-vector velocity on any interaction with terrain relief and other objects. | ||
</dd> | </dd> | ||
<dt><dt> | |||
<dd class="notedate">Posted on August 13, 2019 - 12:55 (UTC)</dd> | <dd class="notedate">Posted on August 13, 2019 - 12:55 (UTC)</dd> | ||
<dt class="note">[[User:R3vo|R3vo]]</dt> | <dt class="note">[[User:R3vo|R3vo]]</dt> |
Revision as of 00:13, 6 April 2021
Description
- Description:
- Description needed
- Multiplayer:
- use
_attachedObj setPos getPos _attachedObj
after setDir to synchronise set direction over the network (see setDir's page for its MP behaviour). - Groups:
- Object Manipulation
Syntax
- Syntax:
- Syntax needed
- Parameters:
- object1: Object - object to attach
- object2: Object - object to attach to
- offset: Array - (Optional) format PositionRelative
- memPoint: String - (Optional) see ArmA: Selection Translations for czech selections names
- followBoneRotation: Boolean - (Optional) follows the memory point's rotation (if attached to one) Template:Since
- Return Value:
- Return value needed
Examples
- Example 1:
player attachTo [car, [0, 0, 1]];
- Example 2:
player attachTo [tank, [0, -1, 0], "Usti hlavne"];
- Example 3:
- Automatic offset:
ammoCrate attachTo [player];
- Example 4:
- To set orientation of attached object use setVectorDirAndUp command:
_expl1 = "DemoCharge_Remote_Ammo" createVehicle position player; _expl1 attachTo [player, [-0.1, 0.1, 0.15], "Pelvis"]; _expl1 setVectorDirAndUp [[0.5, 0.5, 0], [-0.5, 0.5, 0]]; _expl2 = "DemoCharge_Remote_Ammo" createVehicle position player; _expl2 attachTo [player, [0, 0.15, 0.15], "Pelvis"]; _expl2 setVectorDirAndUp [[1, 0, 0], [0, 1, 0]]; _expl3 = "DemoCharge_Remote_Ammo" createVehicle position player; _expl3 attachTo [player, [0.1, 0.1, 0.15], "Pelvis"]; _expl3 setVectorDirAndUp [[0.5, -0.5, 0], [0.5, 0.5, 0]];
Additional Information
- See also:
- attachObjectattachedObjectsattachedTowaypointAttachVehiclewaypointAttachedVehiclelightAttachObjecttriggerAttachVehicleattachedObjectdetachsetVectorDirsetVectorUpsetVectorDirAndUpmodelToWorldBIS_fnc_transformVectorDirAndUp
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
- 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 is 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 is 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. - Posted on March 28, 2014 - 16:22
- Pixinger77
-
If you attach an explosive charge to an object (e.g. ammobox), the charge will not detonate when you simply set the damage to 1. You must detach it before.
private _target = myAmmoBox; // create and attach charge private _charge = "DemoCharge_Remote_Ammo_Scripted" createVehicle position player; _charge attachTo [_target, [0, 0, 0.2]]; _charge setVectorDirAndUp [[0.5,0.5,0], [-0.5,0.5,0]]; // now detonate charge detach _charge; // Important! _charge setDamage 1;
- Posted on 1 Jun, 2014 - 2300
- ffur2007slx2_5
-
(Arma 3 ver 1.20) attachTo overwrites setVectorDirAndUp if attached obj was changed to attach another one.
_obj attachTo [_logic,[0, 0, 0]]; _obj setVectorDirAndUp [[0, 1, 0], [0, 0, -1]]; _obj attachTo [_logic, [0, 0, 2]]; // vector no changes _obj attachTo [_anotherOne, [0, 0, 0]]; // vector changes to default
- Posted on September 25, 2014 - 10:00
- ondrejkuzel
- Attaching an object does not update the accessibility of a place for the AI. The command should not be used for positioning large static objects - the AI will simply walk through such objects.
- Posted on September 1, 2016 - 17:54 (UTC)
- Demellion
- Using attachTo with objects that have ragdoll physics (such as ammo boxes, containers, etc.) may cause unexpected behaviour. When you do so, if the attached object intersect origin object, origin object may gain some enormous collision properties even if the collision model for the attached object is not present localy to origin object, until detached. Vehicles may start flipping with no mass calculation (ie tank might fly), player object might gain infinite Z-vector velocity on any interaction with terrain relief and other objects.
- Posted on August 13, 2019 - 12:55 (UTC)
- R3vo
- When attaching an unit which is playing an animation to a static object, the animation becomes laggy. Presumably because the update frequency of the static object is used.