Forgot to resolve deltaTime to Time.fixedDeltaTime

This commit is contained in:
Jason Durand 01 2022-04-02 13:03:35 -04:00
parent 1112e06d47
commit 87ef184ec7

View File

@ -51,10 +51,10 @@ public class Entity : MonoBehaviour
}
protected virtual void MoveToTarget(){
//Would be nice if we could force this to be in FixedUpdate
direction = Vector3.RotateTowards(direction, (target.position - transform.position), rotSpeed*Time.fixedDeltaTime, 0.0f);
if(!IsInAttackRange()){
rb.MovePosition(transform.position + direction * movementSpeed * deltaTime);
rb.MovePosition(transform.position + direction * movementSpeed * Time.fixedDeltaTime);
}
}