NavMeshAgent sliding bug
Hello,
I'm currently developping a Minecraft style top down shooter but I'm struggling with my AI script. I wrote a complete script that should working perfectly but it's not, so I wrote a very simple script to check where my problem is :
using UnityEngine.AI;
using UnityEngine;
public class NavDebug : MonoBehaviour
{
private NavMeshAgent nav;
private Transform player;
private void Start()
{
nav = GetComponent<NavMeshAgent>();
player = GameObject.FindGameObjectWithTag("Player").transform;
}
private void Update()
{
nav.SetDestination(player.position);
}
}
But this very simple script isn't working as expected, this is what's happening : https://www.youtube.com/watch?v=SVOb5fykmso&feature=youtu.be Each enemy has a capsule collider, a non-kinematic rigidbody, a navmeshagent and the script (the others components are removed for debug purposes) The map has a baked navmesh, so I don't know where the problem is coming from.
Have you already experienced this kind of issues ? Thanks for your help.
Answer by DayMoniakk · Apr 11, 2019 at 02:30 PM
I tested the script into another project and it's working as expected, so maybe my original project is corrupted ?
Your answer
![](https://koobas.hobune.stream/wayback/20220612195001im_/https://answers.unity.com/themes/thub/images/avi.jpg)