Issues with camera+cinemachine

When I set up the main and virtual cameras, exactly like in the course video, everything’s fine until I hit the play button- then both the main and virtual cameras move to 0,0,0 and look down. Then after I cancel play mode, I can’t move neither cameras unless I disable cinemachine on the main camera. If I try to move them again, the moment I turn on cinemachine for the main camera they both move to 0,0,0 again and lock in place. Is this a Cinemachine error or am I just doing something wrong? (again, did step by step exactly as in the video)

Hi stachy,

Welcome to our community! :slight_smile:

When you implement the CinemachineBrain to your game, the CinemachineBrain controls your camera. For this reason, it is the expected behaviour that the camera does not ‘work’ anymore. The CinemachineBrain applies the values from the CinemachineVirtualCamera to the Camera component.

If the cinemachine camera ‘follows’ or ‘looks at’ a game object, you also lose control. This is also the correct behaviour.

If a game object suddenly disappears in front of your camera, check which game object the camera follows. If a game object consists of children, and the children get moved, the camera does not follow the children as it cannot split itself up. It follows only the game object assigned to the ‘Follow’ field.

Without knowing basically anything about your project, I’m afraid this is all what I can suggest (for now). I hope it’ll help anyway. :slight_smile:


See also:

Hi, thank you for the fast reply. I understood all you said, but still, there’s nothing at 0,0,0 that should make the cameras move to it when I start the scene. It doesn’t follow anything, just locks at 0,0,0. No children/parents or any package were added to the scene. Added a screenshot

Maybe there’s something that I’m missing in the component box?

I have tinkered with it a little bit and the problem only occurs when I set the follow to the player cube, which then makes the virtual camera go to 0,0,0 even though there’s nothing in there, instead of locking in the same place it is at that time. What can cause that?

At which position is the cube?

If the camera sees the player in the Game window and if you assign the player to the Follow field, the camera should follow the player with the current settings.

In the Body and Aim menus, you can fine-tune the behaviour. Since there is a yellow triangle, you should at least take a look at it since the yellow triangle indicates a potential problem in Unity. Maybe the problem you are experiencing is caused by something in Body and/or Aim.

Ok, so it was something about the Body and Aim settings, the Body was set in Follow Offset to 0,0,0 instead of the Virtual Camera’s current location which made it move to 0,0,0 every time it was activated.
The yellow triangles were there because I removed the Follow function in order to take the screenshot.
I can set the location of the camera with the Follow Offset settings but not manually through the move tool, is this intentional? In the course video the camera is movable with the move tool…

Yes, that’s intentional. As aforementioned, the CinemachineBrain uses the values from the CinemachineVirtualCamera, and applies them to the Camera.

In the course video the camera is movable with the move tool…

If you use a newer version of the Cinemachine package, it might be that it behaves slightly different than the version Rick uses in the video.

If modifying the values in the Body of the CinemachineVirtualCamera component solved the problem for you, I would suggest to regard this as a solution for your problem, and not to worry that Rick achieved the same result in a slightly different way.

Privacy & Terms