Jump to content
Sign in to follow this  
Kydoimos

Direction of a spawned vehicle or item?

Recommended Posts

Hi all! Is there a way to set the direction a spawned vehicle or item is facing? What's the script for this? I've tried this setdirection 90, etc. but no success!

Share this post


Link to post
Share on other sites

Point the marker where the vehicle spawns in the direction you want the spawned vehicle to face.

Share this post


Link to post
Share on other sites

Thanks, but that's not what I mean. I mean, how do you select the direction of a 'scripted' spawn vehicle or item. For instance, if you spawn a weapon on the ground, or if you spawn a vehicle or building using a script, how do you set the azimuth?

Share this post


Link to post
Share on other sites

Use setDir setDirection is for map locations not objects.

Share this post


Link to post
Share on other sites

I'm using an invisible helipad with the script:

wreck = "Land_Wreck_Offroad_F" createVehicle position this; deleteVehicle this;

But I can't set the azimuth, not even by rotating the original helipad object marker...

---------- Post added at 19:52 ---------- Previous post was at 19:46 ----------

That's fantastic Kylania - thanks again, works perfectly.

---------- Post added at 19:55 ---------- Previous post was at 19:52 ----------

I wonder if there's a similar command to set the elevation? I've had a look on the Arma3 scripting list and couldn't see anything obvious.

Share this post


Link to post
Share on other sites

Elevation is a bit tricky. It's gotten easier in the editor for scripting you have to do it the long way:

An object's location has 3 elements, X, Y and Z. The Z is the elevation. X and Y are it's coordinates. So you'll setPos it to it's same location only with a higher Z.

this setPosATL [getPosATL this select 0, getPosATL this select 1, 200];

So that example keeps the object in it's same X,Y location but puts it 200 meters up on the Z axis, 200 meters "up".

I used setPosATL (above terrain level) since it's spectacularly faster than normal setPos. Also you usually only care about above terrain but sometimes you care about sea level so use setPosASL for that or be lazy and slow and use setPos. :)

Share this post


Link to post
Share on other sites

You genius! Thanks so much! Works like a gem! Going to have some fun now I can place objects and control their direction and elevation etc. Cheers!

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  

×