GameObjects are internally marked as 'invalid' for nav system?

I have an interesting problem - there is a rather complex character in my scene which performs different stages of initialization.

The character has IAPath.cs, Seeker.cs and AIDestinationsSetter.sc attached to it, but the charater doesn’t move anywhere, although it has a target and all the tag masks and graph masks are correct.

This similar setup on an empty game object works fine - it’s just this character-gameObject which seems to refuse to move. The character has a kinematic rigidbody somewhere in child gameObject and a couple of trigger colliders. Maybe it’s because of them?

Entering game play, removing all the components (except path, seeker, sett) and deleting all child gameObjects still doesn’t let character to move.

However :smiley: when I press ‘ctrl+D’ and duplicate this stripped-gameObject, the clone actually moves!
Aron, are you marking gameObjects as ‘invalid’ permanently if they don’t match some criteria, perhaps by ID? How to avoid a gameObject from getting “banned”?

OnPathComplete() is actually called, but on the next frame, the pathInterpolator has ‘null’ path

Huh, I have no idea what could cause that.
Though a kinematic rigidbody as a child object does seem like a strange thing, I don’t think that should cause this, but physics is complicated. What happens if you remove it outside of play mode?

I’ve narrowed it down to the fact that if I remove just this custom character-related script everything works as usual.
If the gameObject contained this script at the start, AIPath will refuse to work thereafter, even if I remove that character-related script later on. But removing script & diplicating gameObject seems to get rid of the curse.

I will investigate my script and will write the cause if found

1 Like

Phew… That was a tough one. In my parent class I called

_navAgent.isStopped = true

and in child class, once my character finished spawning I set

_navAgent.canMove = true

It was really tough to find, because they are so similar and are in two separate .cs files - I strongly vote to depricate and improve the names of isStopped & canMove

They are so similar acording to the documentation, could you please tell me their essential difference?
Thanks!