Jump to content
Sign in to follow this  
mcnools

Preventing objects from aligning to terrain?

Recommended Posts

Well, I've always wondered about this. Is there a way to prevent objects from aligning to the terrain? In other words, stop them from leaning if they're placed on a slope. I'd like to prevent sandbags I place from leaning all over the place etc. Is there any simple way to do it, or do you have to tilt each object manually with some sort of tilt-command?

(in the mission editor of course).

Share this post


Link to post
Share on other sites

you need to change the vector.

there is a bis funtction that does this. but i dont remember the name or use it.

but you can do it with setvectorDir if its the pitch and setvectorUp if its the bank you need to change.

if its both,. you can mix the two commands or use setVectorDirAndUp

http://community.bistudio.com/wiki/setVectorDirAndUp

Share this post


Link to post
Share on other sites

You could just try placing them on flat ground and then using setPos to move them to where you want ;)

Share this post


Link to post
Share on other sites

Make them spawn at a marker:

// For accuracy

_temp setPos _markerPosition;

Should make it level.

Either that, or find the nearest road and _temp setDir direction _nearestRoad

Share this post


Link to post
Share on other sites
Gnat;1830642']
this setVectorUp [0,0,1];

That worked perfectly! thank you very much!

Edit: It seems that it doesn't work together with the setpos-init to raise/lower the object though, is there any way around this?

Edited by McNools

Share this post


Link to post
Share on other sites
That worked perfectly! thank you very much!

Edit: It seems that it doesn't work together with the setpos-init to raise/lower the object though, is there any way around this?

Yes. Do setVectorUp after you have setPos.

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  

×