CameraZoom

Close the end of the lesson everything was very well, when you changed the CameraContrtoller script and rearrange it my zoom mouse is no longer working. My script is exactly as yours but when I run the game an error appears on my console and I don’t know what is wrong. Can you help me please?

What do you have on CameraController line 94?
Something is null, use Debug.Log to find out what https://unitycodemonkey.com/video.php?v=5irv30-bTJw

Thanks for your answer I’ll take a look at the video link you sent me to fix the problem, meanwhile I attach code lines 27 & 94 so you can take a look and realize what is wrong. Regards


Thanks, I’ve found the error, not help needed on this subject anymore.

So that this topic may help others in the future, it looks like the cinemachineTransposer was null, although it appears to be assigned in Start(). Was the issue that the virtual camera’s Body field wasn’t set to a Transposer?

1 Like

Brian, the problem was at the Start() code line 19 I wrote first CinemachineTransposer followed by cinmachinTransposed … I just deleted the first CinemachineTransposer and it got fixed. Regards.

2 Likes

Aha, I see it now on a second look. That can be a tricky error to nail down, everything looks right, but the global reference never gets set.

1 Like

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

Privacy & Terms