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()
{
predictedRigidbody.isKinematic = true; // full transform sync
// remove rigidbody until it's needed again later
if (rigidbodyOnDemand)
{
rbConfig = new RigidbodyConfiguration(predictedRigidbody);
Destroy(predictedRigidbody);
}
else
{
predictedRigidbody.isKinematic = true; // full transform sync
}
state = ForecastState.FOLLOWING;
#if UNITY_EDITOR // PERF: only access .material in Editor, as it may instantiate!