player can enter the door

This commit is contained in:
Vladimir Koshevarov
2023-03-06 18:54:13 +02:00
parent 667c9901b6
commit ac5dce3507
35 changed files with 29063 additions and 1193 deletions
+17
View File
@@ -0,0 +1,17 @@
using UnityEngine;
using UnityEngine.AI;
public class RootMotion : MonoBehaviour
{
private NavMeshAgent _navMeshAgent;
private void Start()
{
_navMeshAgent = GetComponentInParent<NavMeshAgent>();
}
private void OnAnimatorMove()
{
transform.parent.position = _navMeshAgent.nextPosition;
}
}