This commit is contained in:
mischa 2024-04-15 21:32:13 +08:00
parent 693acc409f
commit cd6e67a78e

View File

@ -264,14 +264,16 @@ protected void BeginBlending()
protected void BeginFollowing() protected void BeginFollowing()
{ {
predictedRigidbody.isKinematic = true; // full transform sync
// remove rigidbody until it's needed again later // remove rigidbody until it's needed again later
if (rigidbodyOnDemand) if (rigidbodyOnDemand)
{ {
rbConfig = new RigidbodyConfiguration(predictedRigidbody); rbConfig = new RigidbodyConfiguration(predictedRigidbody);
Destroy(predictedRigidbody); Destroy(predictedRigidbody);
} }
else
{
predictedRigidbody.isKinematic = true; // full transform sync
}
state = ForecastState.FOLLOWING; state = ForecastState.FOLLOWING;
#if UNITY_EDITOR // PERF: only access .material in Editor, as it may instantiate! #if UNITY_EDITOR // PERF: only access .material in Editor, as it may instantiate!