- Home /
Camera Rotation Tips
Hello eveyone. I have a minor problem in my game. I have a camera as a child object for my character. My problem is that i want my player object to rotate but not rotating the camera.
I have tested removing the camera as a child object and implementing a single script that tells it every frame to follow the player object. But that did not feel well. It felt like the player object lagged when it moved. In other words: The camera did not move smoothly with the player object
Do anyone of you have any tips on how i should do this? My friend told me that i could use a empty object as a master object. Then the real playerobject (that is a child) rotate freely. Then have the camera also as a child object of this master object.
I have not tested that out. But it did not sound so good. Do you guys have any tips on how i should do this. Please do tell
Answer by FL · May 19, 2013 at 04:40 PM
To your player object to rotate but not rotating the camera: Use your empty object tip OR rotate the object, but rotate in reverse position the camera the same amount.
camera.position = Vector3.Lerp(camera.position, object.position, Time.deltaTime);
to move the camera smooth.
Thanks for the tips. Going to try that one out. If i fail. Il just go with the empty object :)
Your answer
Follow this Question
Related Questions
Object rotates with camera 2 Answers
Return Camera Rotation Z axis to 0 2 Answers
Wonky Camera Behaviours 0 Answers
I am getting a problem with moving and rotating a camera! 1 Answer
Help with camera snap 1 Answer