I grabbed the nav mesh agent in Awake and then moved it in update. Just curios which way is is more efficient or resource protective… On one side i know some of the tutorials talk about not caching things all the time, on the other side i know you want to minimize what you can in the update callback since its every frame. Also if im caching the agent is it better to do in start or awake?
{
[SerializeField] Transform _targetTransform;
private NavMeshAgent _agent;
private void Awake()
{
_agent = GetComponent<NavMeshAgent>();
}
private void Update()
{
_agent.destination = _targetTransform.position;
}
}