player can enter the door
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user