attachTo – Bohemia Interactive Community

admin 0

From Bohemia Interactive Neighborhood

Leap to navigation
Leap to go looking

Hover & click on on the pictures for descriptions


Attaches an object to a different object.

  • The offset is utilized to the article heart except a reminiscence level is supplied, during which case the offset can be utilized to the reminiscence level place.
  • If no offset is specified, the present offset between the 2 objects can be used.

Utilizing setDir on an connected object units its path relative to the reference object’s path, e.g 0 will make it face the identical path because the reference object, 90 face to the suitable, 180 face to the again, and so on.
Hooked up triggers solely observe the path of the article to which they’re connected, not pitch or roll.
use _attachedObj setPos getPos _attachedObj after setDir to synchronise set path over the community (see setDir’s web page for its MP behaviour).


object1 attachTo [object2, offset, memPoint]
object1: Object – object to connect
object2: Object – object to connect to
offset: Array – (Non-obligatory) format PositionRelative
memPoint: String – (Non-obligatory) see ArmA: Choice Translations for czech choices names
Return Worth:


Instance 1:
participant attachTo [car, [0, 0, 1]];
Instance 2:
participant attachTo [tank, [0, -1, 0], "Usti hlavne"];
Instance 3:
Automated offset: ammoCrate attachTo [player];
Instance 4:
To set orientation of connected object use setVectorDirAndUp command:

_expl1 = "DemoCharge_Remote_Ammo" createVehicle place participant;
_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 place participant;
_expl2 attachTo [player, [0, 0.15, 0.15], "Pelvis"];
_expl2 setVectorDirAndUp [[1, 0, 0], [0, 1, 0]];
_expl3 = "DemoCharge_Remote_Ammo" createVehicle place participant;
_expl3 attachTo [player, [0.1, 0.1, 0.15], "Pelvis"];
_expl3 setVectorDirAndUp [[0.5, -0.5, 0], [0.5, 0.5, 0]];

Further Info

See additionally:
Object Manipulation



Posted on September 17, 2011 – 19:20
Some objects you can’t connect something to. To be extra exact, you’ll be able to connect objects to them, however the behaviour is sudden. As an illustration: SuitcaseObject attachTo [FoldingTableObject, [0,0,0]];
You’ll anticipate the suitcase to leap to the pivot level of the desk, and keep on with it.
As an alternative, the suitcase will freeze in it’s unique place. Even when the desk is moved, the suitcase can be unaffected: it won’t observe the desk, it won’t even reply to actions it reacted to previous to being connected: pushing, being shot at, and so on.. It is simply an object frozen in house. In MP it’s even weirder, the suitcase would flip invisible.
Dodgy objects in terms of attaching issues to them: most in Objects (small), Objects (indicators), all of Objects (helpers) classes, and so on.

Posted on March 28, 2014 – 16:22
In case you connect an explosive cost to an object (e.g. ammobox), the cost won’t detonate if you merely set the harm to 1. You will need to detach it earlier than.
non-public _target = myAmmoBox;
// create and fix cost
non-public _charge = "DemoCharge_Remote_Ammo_Scripted" createVehicle place participant;
_charge attachTo [_target, [0, 0, 0.2]];
_charge setVectorDirAndUp [[0.5,0.5,0], [-0.5,0.5,0]];
// now detonate cost
detach _charge; // Essential!
_charge setDamage 1;

Posted on 1 Jun, 2014 – 2300
(ArmA3 ver 1.20) attachTo overwrites setVectorDirAndUp if connected obj was modified to connect one other one.
_obj attachTo [_logic,[0, 0, 0]];
_obj setVectorDirAndUp [[0, 1, 0], [0, 0, -1]];
_obj attachTo [_logic, [0, 0, 2]]; // vector no adjustments
_obj attachTo [_anotherOne, [0, 0, 0]]; // vector adjustments to default

Posted on September 25, 2014 – 10:00
Attaching an object doesn’t replace the accessibility of a spot for the AI. The command shouldn’t be used for positioning giant static objects – the AI will merely stroll by such objects.

Posted on September 1, 2016 – 17:54 (UTC)
Utilizing attachTo with objects which have ragdoll physics (corresponding to ammo bins, containers, and so on.) might trigger sudden behaviour.
If you accomplish that, if the connected object intersect origin object, origin object might achieve some monumental collision properties even when the collision mannequin for the connected object just isn’t current localy to origin object, till indifferent.
Autos might begin flipping with no mass calculation (ie tank would possibly fly), participant object would possibly achieve infinite Z-vector velocity on any interplay with terrain reduction and different objects.
Posted on August 13, 2019 – 12:55 (UTC)
When attaching an unit which is enjoying an animation to a static object, the animation turns into laggy. Presumably as a result of the replace frequency of the static object is used.

Backside Part

Leave a Reply

Your email address will not be published. Required fields are marked *