Cinemachine follow bug

Hi, i added spawn points to my platformer, so when you die you re-spawn at the saved transform.position (i don’t destroy the player component), the thing is that when i re-spawn the camera moves to the re-spawn point but not exactly, the player is on the edge of the screen and not the middle…but the second i press a key to move the player the camera snap to the center…any thoughts??

Hi Yehiel,

Could you share screenshots of what you see in Unity, please?

Hi Nina,
here’s a small video with a fix i tried, https://youtu.be/jGt7MQLScQU
Now the player reaches a saving point, continues and die, he is then re-spawns on the save point (i changed the follow of the Vcam to the point and a sec later back to the player) , the camera fixes on the player but now when i move the player there’s a jitters with the camera before it follows again…

Hi, its been a while and i tried some staff, nothing works yet…i found out the cause…i think…

when i start a scene the camera is lock to the player transform.position and everything is good, once the player reaches a checkpoint i save the position and after the player dies i restart the scene and tell the player script to get the saved position from the game manager script, but the camera on goes to that position after i start moving the player…is there a way to to tell the camera about the new position??

What type of camera is it? A normal camera controlled by your code? If so, you could set its position via a reference (“link”) to that camera.

If the camera references your player and you destroy your player, you need to assign the new player to the field. This must be done via a reference.

I meant a virtual camera, found a solution that works, i add the player as follow by script after it is spawned and it works ok, thanks :sunglasses:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.