Third Person Controller 3.0.4.
Updating the camera in FixedUpdate will never be smoother than in LateUpdate. So I try to update camera in LateUpdate and it works fine.
I made these changes to get it done:
1. Modify the update camera in SimulationManager.
2. Interpolate the character's Rigidbody.
3. Change the Update Mode of the character's Animator to Normal.
4. Modify the character IK.
5. I implemented my own MovementType and ViewType.
After doing this, everything is smooth. Both high and low frame rates feel great.
This proves that this feature is fully achievable, please improve it to make the controller more optional, thanks.
Updating the camera in FixedUpdate will never be smoother than in LateUpdate. So I try to update camera in LateUpdate and it works fine.
I made these changes to get it done:
1. Modify the update camera in SimulationManager.
Code:
/// <summary>
/// Executes physical simulation during the FixedUpdate loop.
/// </summary>
private void FixedUpdate()
{
MoveKinematicObjects();
MoveCharacters();
}
/// <summary>
/// Executes Cameras update during the LateUpdate loop.
/// </summary>
private void LateUpdate()
{
RotateCameras();
MoveCameras();
}
2. Interpolate the character's Rigidbody.
3. Change the Update Mode of the character's Animator to Normal.
4. Modify the character IK.
Code:
/// <summary>
/// Updates the hip position during the FixedUpdate loop.
/// </summary>
public void FixedUpdate()
{
if (m_Animator.updateMode == AnimatorUpdateMode.AnimatePhysics)
{
m_Hips.position = m_Transform.TransformPoint(m_HipsPosition);
}
}
/// <summary>
/// Updates the IK component after the animator has updated.
/// </summary>
public void LateUpdate()
{
if (m_Animator.updateMode != AnimatorUpdateMode.AnimatePhysics)
{
m_Hips.position = m_Transform.TransformPoint(m_HipsPosition);
}
// After the IK has finished positioning the limbs for the first time reset the immediate position. It should smoothly blend
// during runtime.
if (m_ImmediatePosition)
{
m_ImmediatePosition = false;
}
}
5. I implemented my own MovementType and ViewType.
After doing this, everything is smooth. Both high and low frame rates feel great.
This proves that this feature is fully achievable, please improve it to make the controller more optional, thanks.