Arma 3
112 ratings
How to attach one object to another
By JackFighter
Just a small reminder how to use attachToRelative function
[this, ] call BIS_fnc_attachToRelative
6
2
   
Award
Favorite
Favorited
Unfavorite
2 easy steps
1. Specify the main object (eg, core) by giving Variable Name to it. All other objects would be attached to this specified object. In this example Variable Name for core object is blueOffroad.
2. Use command [this, blueOffroad] call BIS_fnc_attachToRelative in init of any other object to attach this object to the core.

After this object with function in init (mortat) will be physically attached to the "core" object (blue offroad) with respect to its position in 3d editor. Attached objects do not collide or interfere with core object.
28 Comments
Christian 4 Jan, 2024 @ 9:36pm 
AI won't operate vehicles helis etc with this script
Gameplay1703 17 Feb, 2023 @ 5:05pm 
trust me i tried
Gameplay1703 17 Feb, 2023 @ 5:04pm 
how can i attach backpacks and weapons to vehicles ?
attachto/attachtorelative doesnt work for inventory items
deadweight 21 Nov, 2022 @ 5:25pm 
i love this guy for posting this. thx
starch 1 Dec, 2021 @ 6:33pm 
yes it can apply to pub zeus
Seridis van der Egix 30 Oct, 2021 @ 4:20am 
can this apply to public zeus with th profile launcher and custom compositions?
De Gaulle 27 Oct, 2021 @ 6:39am 
Thx! ^)
Alex 20 Aug, 2020 @ 4:34pm 
Jack Fighter We Kinda Have The Same Profile Pic
GreenLion 30 Dec, 2019 @ 8:38am 
@JackFighter Oh okay, thanks for your help. The objects change rotation when I try to move them all together. I will have to search for some extra code probably :)
JackFighter  [author] 30 Dec, 2019 @ 8:30am 
@GreenLion, well, this function wouldn't do so in editor, it wires objects in game. To move 2 and more objetcts in editor just select them together. But I think I really misunderstand you