- Home /
Rotate camera and player to face object
Hello everyone, I am new to Unity and I'd like to ask you a question to deal with a problem I am having. I apologize in advance for the long message. I am making an FPS test game and using the default script "MouseLook", "FPSInputController" and "CharacterMotor". In my scene I'd like to make a cutscene where the player stop moving and look at game object. I was able to stop the player movement by disabling the script "Character Motor" and to stop the camera rotation with the mouse by disabling the script "MouseLook" when the player enter into a trigger collision. Problem is how can I make the player and the camera rotate smoothly to look at the game object? I have had several test on achieve this but none of them seems to be working fine. If I rotate only the player he will rotate to the game object but the camera will not point the target properly (example: the player is looking down before entering the collision trigger, then when I try to rotate him to face the target the camera still remain to look down). If I try to rotate the camera and later on to enable the "MouseLook" the camera suddenly change position to the previous one the player was facing... (example: the player is facing down before entering the collision, the camera rotate to look at the target but later when I enable the script "MouseLook" again the camera return to face down). So how can I rotate the character and the camera to look at an game object regardless of the previous position of the camera? Also when I re-enable the "MouseLook" script how can I tell the camera to save the new position and not to return to the oldest one it was facing before entering the collision trigger? I hope someone can help.
Your answer
Follow this Question
Related Questions
problem with rotate camera around player 0 Answers
How to Rotate Camera around GameObject (Player) 0 Answers
Camera rotation around player while following. 6 Answers
How to make camera not rotate with player, only move 1 Answer
I need animate arms with script when I rotate my character like in Escape of Tarkov 0 Answers