Hi,
my player moves via path finding (nav mesh) by clicking on a point. When i click on a point, the player moves to the point and triggers an animation. Now i want to trigger another animation parameter, when the player stops moving (reaches the destination point)
This is my player code:
using UnityEngine;
using UnityEngine.AI;
public class ZeroCTRL : MonoBehaviour
{
public Camera kamera;
public NavMeshAgent zero;
public Animator anim;
void Start ()
{
}
void Update()
{
if (Input.GetMouseButtonDown(0))
{
Ray position = kamera.ScreenPointToRay(Input.mousePosition);
RaycastHit click;
if (Physics.Raycast(position, out click))
{
zero.SetDestination(click.point);
anim.SetTrigger(name: "bewegen");
}
}
}
}