Jump to content
Sign in to follow this  
hogmason

spawn at rear of vahicle

Recommended Posts

ok so i whipped this up to spawn an ammobox from a car addaction but cant figure out how to get it to spawn directly behind the vehicle


_vehicle = _this select 0;
_person = _this select 1;

_dist = 1;
[color="#FF0000"]_dir = random 180; // this needs to be rear of the car or _vehicle[/color]
_pos = [((getPos _vehicle) select 0) + (sin _dir) * _dist, ((getPos _vehicle) select 1) + (cos _dir) * _dist, 0];


_deploy = "USBasicWeaponsBox" createVehicle (getPos _vehicle);

Share this post


Link to post
Share on other sites
_behind = _vehicle modelToWorld [0,-10,0]; // 10m directly behind, but floating for some reason... (probably center of model)
_box setPosATL [_behind select 0, _behind select 1, 0]; // ... so land it.

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  

×