Set destination of a NavMeshAgent when instantiating

I’m trying to set the destination of an agent when it spawns, but, as I intanciate it, Unity returns this error:


I’ve seen posts where people recommend using agent.Warp instead of transform.position, but I’m not even setting its position, because I’m spawning it from another object.

Good day Uri677 !

I supose you are instantiating the object, and then moving its position where you want.

When an object have a NAvMeshAgent, is better use this to change iots posotion:


This way the object is placed over the NavMeshArea ready for setting its destination.

If helpped, please accept the answeer :smiley:

Bye !