Question by
Prmetheus · Mar 25, 2020 at 11:09 AM ·
camerarotationtransformquaternionfps controller
Add Rotation from parent to Quaternion Child
I've added a input to my cameras rotation, which is a child of the players object (standard fps setup, nothing fancy):
mainCam.transform.rotation = Quaternion.Euler(clampedRotation,transform.rotation.y, transform.rotation.z);
works fine. The problem is, that my camera is no longer rotating with the y axis of the parent, the camera is basically just locked and is looking forward, even though the player itself still rotates when input is added.
Any ideas?
Comment
Best Answer
Answer by Prmetheus · Mar 25, 2020 at 11:17 AM
Was able to fix it. I've had to use transform.eulerAngles.y
instead of transform.rotation.y
mainCam.transform.rotation = Quaternion.Euler(clampedRotation, transform.eulerAngles.y, transform.rotation.z);
Your answer
Follow this Question
Related Questions
Help with rotating camera around object based on mouse input 0 Answers
How to rotate a camera slowly along a tween? 1 Answer
Camera X Rotation Problems 0 Answers
Rotation problem 0 Answers