Log in to reply
 

How do I rotate an Entity towards a Vector3 position?



  • How do I rotate an Entity towards a desired vector3 position in C#?



  • This will rotate the player to the right of the player. Change entity and position as needed.
    ``
    Vector3 facePosition = Game.Player.Character.Position + Game.Player.Character.RightVector * 2;// position to face to the right of player
    float rotation = Function.Call<float>(Hash.GET_HEADING_FROM_VECTOR_2D, facePosition.X - Game.Player.Character.Position.X, facePosition.Y - Game.Player.Character.Position.Y);
    Game.Player.Character.Heading = rotation;


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.