0
\$\begingroup\$

I want the camera to follow a character as he moves around. So I did the following:

  • Position the camera behind and slightly above the character.
  • Add a Cinemachine Brain component to the camera.
  • Create a GameObject containing a Cinemachine Virtual Camera component. Set its LookAt and Follow properties to the character to be followed.
  • Run the game.

I expect for the camera to follow the character, more or less maintaining the relative position and orientation I had set for it. (ie. more or less as if the camera object was parented to it, but smoother.)

If I use the Cinemachine Free Look camera, this is basically how it works, except that it only deals with following and I have to maintain the orientation manually with the mouse. But if I use Cinemachine Virtual Camera, because I don't want to deal with the free look part of it, for some bizarre reason it locks the position of the GameObject containing the camera to (0, 0, 0)! And I don't just mean it moves it there; it's stuck there! If I go into the Inspector and change the position at runtime, it instantly changes back to (0, 0, 0).

What can cause Cinemachine Virtual Camera to do this? And how can I make it stop?

\$\endgroup\$
1
  • \$\begingroup\$ Can we see an image of the properties of your Cinemachine Virtual Camera and the Brain? \$\endgroup\$ Jan 23 '21 at 21:31
1
\$\begingroup\$

It is about the properties of the Virtual Camera. Tons of options are available when Virtual Camera is selected. You can check the documentation of it here

When you add a Virtual Camera on a scene, its Body property is set to Transposer and its Aim property is set to Composer. Body property determines how to follow the object in terms of world positions when you add a Transform to Follow variable and Aim property determines the rotation of the camera.

If you want a 3rd Person like follower camera for your object, you can use Virtual Camera and set Body property and Aim property to Transposer & Hard Look At, respectively. When these properties is set, your objects Transform has to be assigned to the Follow & Look At variables.

\$\endgroup\$
3
  • \$\begingroup\$ Well that helped, but now everything bounces around horribly when the character walks. No matter how I adjust damping, the view still bounces and shakes with every movement as if the camera was simply parented to the character, which is the specific reason why I wanted to use Cinemachine instead of simply parenting the camera to the character! Is there any way to make it move smoothly? \$\endgroup\$ Jan 24 '21 at 0:36
  • \$\begingroup\$ You can change Body to Framing Transposer, and play with Aim property as well. You can reduce the bounce & shake with playing damping values & Lookahead Time & Smoothing but the things you menioned are inevitable. If you want a 3rd person like camera, there is no way to make the camera will be unresponsive to the movement of your object. Are you sure you want to use a camera type that is responsive to the position & rotation change of your object? \$\endgroup\$
    – TumayVarel
    Jan 24 '21 at 12:21
  • \$\begingroup\$ "Responsive to the position & rotation change of your object" is an implementation detail I don't particularly care about. What I want is a camera that will 1) follow the character, 2) keep them more-or-less centered on the screen, and 3) do so smoothly. \$\endgroup\$ Jan 24 '21 at 14:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .