- Home /
Question by
Dude0one · Jul 23, 2014 at 07:19 AM ·
navmeshagentdestination
Having problems with scripting Nav Mesh Agent for an enemy
Help! I wrote the text below in my script and I get error:
transform.GetComponent("NavMeshAgent").destination = target.position;
Error 'destination' is not a member of 'UnityEngine.Component'
Comment
Answer by SkaredCreations · Jul 23, 2014 at 09:14 AM
If you are using C# then use the method GetComponent (without spaces between ) so it automatically converts the component to NavMeshAgent, else you need to manually cast it.
Your answer
Follow this Question
Related Questions
A lot of navmesh agents affects ai accuracy 0 Answers
Problem with Navmesh 1 Answer
Problem accessing NavMeshAgent 2 Answers
100+ navmesh agents are not accurate 0 Answers
How to check if my player agent is at the end of the position 2 Answers