Barba-negra 117 Posted June 29, 2019 Hello friends how are you? I come to ask if it is possible to make an attachTo an enemy without a variable name, either a unit or a vehicle, I have this in mind but it really does not work _list = fijado nearEntities [["Car", "Motorcycle", "Tank", "Man"], 100]; { fijado attachTo [_list, [0, 0, 0] ]; }; Share this post Link to post Share on other sites
pierremgi 4739 Posted June 30, 2019 Hello. What do you want to obtain? attachTo needs an object, not a list... What do you want to attach on what? Share this post Link to post Share on other sites
Barba-negra 117 Posted June 30, 2019 22 minutes ago, pierremgi said: Hello. What do you want to obtain? attachTo needs an object, not a list... What do you want to attach on what? If I know it's complicated, I want to create like a magnet, an object that joins or a vehicle when the vehicle passes by, but my intention is to do it with any vehicle without having to give it a variable name Share this post Link to post Share on other sites
whiztler 135 Posted June 30, 2019 7 hours ago, Barba-negra said: If I know it's complicated, I want to create like a magnet, an object that joins or a vehicle when the vehicle passes by, but my intention is to do it with any vehicle without having to give it a variable name Have a look at the forEach command. It lets you execute a command on items in an array (which your list of objects is) 1 Share this post Link to post Share on other sites
pierremgi 4739 Posted June 30, 2019 If I understand, you want to attach an object named fijado when some enemy close its position. If yes, you can place a trigger on fijado position, with a little area, OPFOR or BLUFOR or .... PRESENT, server only then in on activation field: fijado attachTo [thislist select 0, [0,0,2]] The result is not beautiful because you can't guess the "offset" or the "memory point" on the enemy, if you want to match all kind of enemies. 1 Share this post Link to post Share on other sites
Barba-negra 117 Posted June 30, 2019 It's a good idea I'll try to see what the result is and I'll tell you guys Share this post Link to post Share on other sites
Barba-negra 117 Posted June 30, 2019 Thanks @pierremgi is working excellently, you are great Share this post Link to post Share on other sites