transition to FOLLOWING

This commit is contained in:
mischa 2024-04-03 18:57:38 +08:00
parent 785aa036a3
commit 15452d1f9b

View File

@ -135,7 +135,7 @@ protected void BeginBlending()
Debug.Log($"{name} BEGIN BLENDING");
}
protected void BeginFollow()
protected void BeginFollowing()
{
predictedRigidbody.isKinematic = true; // full transform sync
state = ForecastState.FOLLOWING;
@ -272,6 +272,13 @@ void FixedUpdateClient()
// assign rigidbody position & rotation while keeping velocity to keep moving
predictedRigidbody.MovePosition(newPosition);
predictedRigidbody.MoveRotation(newRotation);
// transition to FOLLOWING once p = 100%
if (p >= 1)
{
Debug.Log($"{name} END BLENDING");
BeginFollowing();
}
}
else if (state == ForecastState.FOLLOWING)
{