New answers tagged

0

I don't know why this works, but this is how I got my problem fixed. I believe the problem occurs when you have both a navmesh agent on the object as well as a rigidbody. Remove the rigidbody and it should work pretty well. But in my case I changed the Collision Detection on the rigidbody component of my Nav Mesh Agent GameObject from 'Discrete', to '...


-2

using System.Collections; using System.Collections.Generic; using UnityEngine; public class MoveEnemy : MonoBehaviour{ //link the player// public GameObject player; //fix the speed// public float speed; void Update () { gameObject.transform.position = Vector3.MoveTowards(gameObject.transform.position, player.transform.position , Time.deltaTime*...


Top 50 recent answers are included