Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
johnnyboy

Apply speed boost to Z parameter in setVelocity

Recommended Posts

I want to increase velocity across x, y, and z velocity parameters. Currently I only can make it work in 2D (x and y). This setVelocity example from wiki works in 2D only:

_vel = velocity _vehicle;
_dir = direction _vehicle;
_speed = 10;
_vehicle setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+ (cos _dir*_speed),(_vel select 2)];

My speed boosts only work horizontally. When vehicle is pointed up or down, I need to apply some function to the third Z parameter.

What is that? Tangent? Any examples out there?

Thanks!

Share this post


Link to post
Share on other sites
_vel = velocity vehicle player;
_zBoost = 10;
vehicle player setVelocity [_vel select 0,_vel select 1, (_vel select 2) + _zBoost];

Share this post


Link to post
Share on other sites
Sign in to follow this  

×