Liberty Unleashed
Scripting => Script Tutorials => Topic started by: Shadow. on July 27, 2013, 01:15:54 am
-
If you didn't know, setting a vehicle's angle points to weird directions, well, here is your fix!
Instead of passing degrees, you must pass a radian.
I provided a simple DegreesToRadians function below:
function DegreesToRadians(deg)
{
local rad = deg * PI / 180.0;
return rad;
}
You will have to do
vehicle.Angle = DegreesToRadians(desiredangle);
Usage example:
vehicle.Angle = DegreesToRadians(180);
The above example will set 'vehicle' s angle to 180.
-
Nice!
This will be very helpful.
-
How is it possible that no one tried to set the vehicle angle before, when LU is available for almost 3 years?
-
How is it possible that no one tried to set the vehicle angle before, when LU is available for almost 3 years?
We have set the vehicle angle before but it would just turn it in some bizarre direction instead of the desired one.
-
Vortex, that's even more weird... Why did no one report, that "setting angle doesn't work" then?
-
Somebody did already, but we didn't know there was a script side fix until Shadow introduced it.
http://forum.liberty-unleashed.co.uk/index.php/topic,1157.msg7356.html#msg7356 (http://forum.liberty-unleashed.co.uk/index.php/topic,1157.msg7356.html#msg7356)