- Home /
Minotaur Enemy not moving towards FPS controller
So I am using the Minotaur Asset from the Unity Store (free one by VSIFY). What I want it to do is for the Minotaur to follow the FPS Controller, but all it does is walk in spot. It doesn't move around the map, just on the spot. I am using a Nav Mesh Agent (if this has anything to do with it).
Here is the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class FollowAI : MonoBehaviour
{
public GameObject theTarget;
NavMeshAgent theAgent;
void Start()
{
theAgent = GetComponent<NavMeshAgent>();
}
void Update()
{
theAgent.SetDestination(theTarget.transform.position);
}
}
Have you tried to debug the one line in update to see if it returns true or false??
@highpockets No, I have not and what do I type on that line?
Debug.Log(theAgent.SetDestination(theTarget.transform.position));
I have added that code in and it returns saying "false" @highpockets
do you have a navmesh generated? Nav$$anonymous$$eshAgent works with Nav$$anonymous$$esh :)
I do have Nav$$anonymous$$esh generated @Panga$$anonymous$$i
Hello.
Seeing your problems, you should create another scene, and make a simple cube to move over a simple plane using navmesh system.
Then replace the plane for your real terrain
Then replace the cube for miotaur, etc...
Step by step, so you will find where the problem is exactly.
PS: I can ensure you Unity is doing it good, "you are the problem" :D
Bye!
Answer by ThePixelatedSword · May 27, 2019 at 07:10 PM
You must first bake a navmesh by going to the top bar in the editor then going window/navigation. I think that is the path but not sure I don't currently have the editor open. Also if it isn't marked as static, it will not bake. You'll know what is navigable because it will be blue.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Lean/Peak system 1 Answer
Enemy Combat AI 1 Answer
get enemy to chase and shoot at player wherever hes facing. 0 Answers