- Home /
How to rotate a camera relative to the player ?
Hey guys, I am making a car game as my first game in unity.
I want the camera to rotate relatively to the car. I was able to move the camera relatively to the car, but I do not know how to rotate it.
This is an example of a code I wrote, that does not work :
playerAngle = new Vector3 (player.transform.rotation.eulerAngles.x, player.transform.rotation.eulerAngles.y, player.transform.rotation.eulerAngles.z); cameraAngle = new Vector3 (transform.rotation.eulerAngles.x,transform.rotation.eulerAngles.y, transform.rotation.eulerAngles.z);
cameraAngle = playerAngle;
Thank you for your support !
please format your code using the 101/010 button, not make it bold.
Your answer
Follow this Question
Related Questions
FPS Camera Control rotation limits 1 Answer
Camera gets stuck when cursor is locked 0 Answers
First Person Camera looking down 1 Answer
Adding an offset to an instantiated objects rotation 0 Answers
I can't figure out how to clamp it 2 Answers