Jump to content
Sign in to follow this  
pcc

setpos entire group including their vehicles

Recommended Posts

I'm trying to teleport an entire group including vehicles with

{
	_x setPos ([_destination,50,50 * 1.3] Call GetRandomPosition);
} forEach unit _team;

but the team's vehicles gets left behind.  How to do I teleport their vehicles too within this loop?

Share this post


Link to post
Share on other sites

See if this works:

_vehs = []; 
{
	if (vehicle _x == _x) then 
	{
		_x setPos ([_destination,50,50 * 1.3] Call GetRandomPosition);
	} else 
	{
		if !(vehicle _x in _vehs) then 
		{
			vehicle _x setPos ([_destination,50,50 * 1.3] Call GetRandomPosition); 
			_vehs = _vehs + [vehicle _x];
		};
	};
} forEach units _team;

 

Edited by opusfmspol
corrected
  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×