Currently I was trying to achieve a smooth transition and camera follow when the player was falling.
But, When player falls it either goes :
On Increased Y Damping → Follow is Smooth, but player is off camera when falling
On Increased Y Damping and also Increasing Y Soft zone Height → same as the first one
On Decreased Y Damping → Follow is Harsh, but Player is in camera
On Increased Y Damping and decreasing Y Soft zone Height → same as 3.
Q: How can we have both smooth transition as well as not loose track of the player when falling ?
I was thinking if we can also enable lookahead for Y when falling, currently it is enabled but lookahead doesnt seems to work on falling.
It sounds like you’re looking for 2 different camera behaviours, depending on whether or not the player is falling. You can set this up with 2 vcams A and B, identical except for a difference in the damping setting. When the player is not falling, enable vcam A, when it it falling, enable vcam B.
Alternatively, you can try to do it with a single vcam with a custom script that modifies the vcam damping setting. When the player begins to fall, decrease the damping. When the player is not falling, bring the damping back to normal.
I have the same problem. I’m trying to change the YDamping as suggested by @Gregoryl but it’s not working.
Here’s what is happening:
acidicdisgustingalpaca
I’ve attached a pic with my Framing Transposer settings. I want the player to not be centred on the Y so I changed the “Tracked Object Offset”
Here’s the code (I’ve verified and _playerMovement is returning the correct values)
public class VirtualCamera : MonoBehaviour
{
private CinemachineVirtualCamera _camera;
private PlayerMovement _playerMovement;
private CinemachineFramingTransposer _transposer;
private void Awake()
{
_camera = GetComponent<CinemachineVirtualCamera>();
_transposer = _camera.GetCinemachineComponent<CinemachineFramingTransposer>();
_playerMovement = FindObjectOfType<PlayerMovement>();
}
public void Update()
{
if (_playerMovement.isGoingDown)
{
_transposer.m_YDamping = 1;
}
else if (_playerMovement.isGoingUp)
{
_transposer.m_YDamping = 10;
}
}
}
@Piotrone I think your problem is not damping, it’s dead zone. Because of your large dead zone, there is nothing that tells the camera to recenter the character. See this thread for some advice about how to implement this kind of situation: