Hello,
I kind of dislike the pathfinding automaticaly setup with the navmesh utilisation.
Is there a way to still use a navmesh agent but to remove the pathfinding composant ?
At the moment we have this :
//speedFraction refere to ennemy patrol fraction speed in AIController
public void StartMoveAction(Vector3 destination, float speedFraction)
{
GetComponent<ActionScheduler>().StartAction(this);
MoveTo(destination, speedFraction);
}
public void MoveTo(Vector3 destination, float speedFraction)
{
navMeshAgent.speed = maxSpeed * Mathf.Clamp01(speedFraction);
navMeshAgent.destination = destination;
navMeshAgent.isStopped = false;
}
I guess i should replace the navMeshAgent.destination by something more like :
- Draw a line between the player and the target
- try go to there as a direct path
But a have no idea how to do that ^^’
If someone could help me on this
Many thanks !