OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: UH60MG on 14 Jun 2008, 18:06:49
-
Suppose I want to add a velocity to a flying aircraft with the SetVelocity command. I want the velocity to be in direction A degrees from the centre of the aircraft and the magnitude to be B. How would I go about doing this?
Basic maths I know but I'm lazy :)
-
I understand you want to keep a constant horizontal velocity without climbing/diving:
// velocity is in m/s
_vel = 30;
_dir = 180;
while {true} do
{
_vehicle setDir _dir;
_vehicle setVelocity [sin(_dir)*_vel, cos(_dir)*_vel, 0];
Sleep 0.005;
};
-
Just what I was looking for. Thanks.