Author Topic: How to set a vehicle's angle correctly.  (Read 3244 times)

Shadow.

  • Tester
  • Full Member
  • ****
  • Posts: 144
  • Karma: +16/-35
    • View Profile
How to set a vehicle's angle correctly.
« 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:

Code: [Select]
function DegreesToRadians(deg)
{
local rad = deg * PI / 180.0;
return rad;
}

You will have to do
Code: [Select]
vehicle.Angle = DegreesToRadians(desiredangle);
Usage example:
Code: [Select]
vehicle.Angle = DegreesToRadians(180);
The above example will set 'vehicle' s angle to 180.

Vortrex

  • Full Member
  • ***
  • Posts: 267
  • Karma: +54/-73
    • View Profile
Re: How to set a vehicle's angle correctly.
« Reply #1 on: July 27, 2013, 04:05:09 am »
Nice!

This will be very helpful.

NC

  • Full Member
  • ***
  • Posts: 101
  • Karma: +2/-3
  • cipa
    • View Profile
Re: How to set a vehicle's angle correctly.
« Reply #2 on: July 27, 2013, 02:38:04 pm »
How is it possible that no one tried to set the vehicle angle before, when LU is available for almost 3 years?

Website online:
My YT channel: http://www.youtube.com/user/1234sdg131

Vortrex

  • Full Member
  • ***
  • Posts: 267
  • Karma: +54/-73
    • View Profile
Re: How to set a vehicle's angle correctly.
« Reply #3 on: July 27, 2013, 10:52:18 pm »
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.

NC

  • Full Member
  • ***
  • Posts: 101
  • Karma: +2/-3
  • cipa
    • View Profile
Re: How to set a vehicle's angle correctly.
« Reply #4 on: July 28, 2013, 12:09:35 pm »
Vortex, that's even more weird... Why did no one report, that "setting angle doesn't work" then?

Website online:
My YT channel: http://www.youtube.com/user/1234sdg131

Vortrex

  • Full Member
  • ***
  • Posts: 267
  • Karma: +54/-73
    • View Profile
Re: How to set a vehicle's angle correctly.
« Reply #5 on: July 28, 2013, 07:28:02 pm »
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

 

© Liberty Unleashed Team.