Hi, I’m making a little script to simulate drone movement on camera and I’ve got a problem with applying proper rotation to the camera.
Rotation can be applied via Camera.Rotation or native SetCamRot which takes rotationOrder parameter. After experimenting and applying all possible rotation orders (0 to 5) neither of them does suit my needs. I need to apply roll first and then yaw and pitch.
So is there another way to do it? Is it possible to set camera’s rotation by quaternion or somehow override rotation manually?
1 Like
were you able to figure it out?
That was a long time ago, so do not remember exactly. After looking briefly at source code for the script I was making, it seems I did all the rotations in quaternions and before using SetCamRot I just converted the desired rotation to Euler angles again. You can browse my code here (function UpdateDroneRotation() does the mentioned stuff): FiveM-Enhanced-Camera/DroneCam.cs at 1fb11280e5855f9fbe04caaafe10d2001a0788c1 · Shrimpey/FiveM-Enhanced-Camera · GitHub
1 Like
Thank you ver much!