Camera Follow Problem
I'm having a problem with my camera follow script, the effect I want is to have the camera follow the player as it slides down a slope, with no rotation or movement as the player moves left and right on screen. I have some code that follows the player fine, but the camera rotates and moves as the player does, and the camera points the wrong way round (forward). I've tried using the Lookat Target script, which points the camera the correct way round (reverse), but still can't get the movement to work properly.
Here is my code: public GameObject player; private Vector3 offset; void Start () { offset = transform.position; } void LateUpdate () { transform.LookAt(player.transform.position); transform.position = player.transform.position + offset; }
I'm sure there is a ver simple solution that I'm missing here, but I'm having no luck, any help is appreciated.
Your answer
Follow this Question
Related Questions
How to make 2 different actions for the same input? 2 Answers
(Newbie's First Project) Object doesn't stop moving until long after I let go of the button 1 Answer
Regarding transform.position in the roll a ball tutorial 0 Answers
How To Move My Player With Sin And Cos Functions 1 Answer
how to cancel all other action while combat or dash? 1 Answer