- Home /
Smooth camera follow does not keep up with increasing velocity
Hello,
I am using the SmoothDamp camera follow script in the Unity docs: http://docs.unity3d.com/ScriptReference/Vector3.SmoothDamp.html
I'm trying to use this for an infinite runner where the speed of the player increases over time. Because of this gradual increase, the camera follow script can't seem to keep up and gradually gets left behind. I've recorded a video of what happens in-game: https://youtu.be/PjWok3sHDOc
You can see that tall pink cube slowly inching it's way into view. I've narrowed it down to the gradually increasing speed because when I keep the speed constant, I do not encounter this issue.
Would you game dev/Unity pros be able to assist me? Do I need to account for the gradual increase in speed in the camera follow script?
Thanks so much.
edit: I wanted to add that my character is moving forward. If i keep the character stationary and move the platforms and background toward the player instead, there are no issues. I suppose I can do that instead, but still would like to know if there's a solution for this. thanks again.
Your answer
Follow this Question
Related Questions
camera follow with distance 1 Answer
2D camera follow horizantal only? 1 Answer
2d camera follow 3 Answers
Switching camera between characters 0 Answers