improve movements

This commit is contained in:
2023-03-02 23:18:32 +02:00
parent 62df90bb52
commit f5733d0ffd
2 changed files with 21 additions and 5 deletions
+1
View File
@@ -138,6 +138,7 @@ public class Player : MonoBehaviour
{
if (Vector3.Distance(destination, _navAgent.transform.position) <= _navAgent.radius)
{
transform.position = destination;
if (!_navAgent.hasPath || _navAgent.velocity.sqrMagnitude < 0.2f)
{
SetPlayerAnimation(AnimationStates.Idle);