Jump to content

[HELP] Finding specific angle


LabiVila

Recommended Posts

Hello, I need some help finding a specific angle. So let me start, I want this:

I need to get local player's rotation and display the rotation he has to do in order to be looking on the direction of the object. Like: 'you have to turn `degrees` to face the object'.

 

I can't seem to do the right math, thank you in advance! 

Link to comment

there is a useful function called findRotation.

use it to find the rotation between the object and the ped. Then getPedRotation or getElementRotation to get the rotation of the ped. After that you will just need to decrease the small angle from the big angle.

So if rotation between an object and ped is 350 and the ped's rotation is 180 then he has to turn 350-180= 170 degrees.

  • Like 2
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...