- Home /
Question by
Jontac · Apr 14, 2019 at 11:09 AM ·
navmeshagentreferenceattached
NavMeshAgent from object that the script is attached to.
Noob question but isn't
NavMeshAgent agent = GetComponent();
supposed to reference the object it's attached to by default? I keep having to add it manually in Unity but I want it done in the script.
Thanks and Cheers!
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612195438im_/https://answers.unity.com/themes/thub/images/avi.jpg)