Seek is randomly considered 'success', but it isn't

Craze

New member
Hello !

I have a bit of an issue with 'seek'.
Sometimes, everything will just works as intended, my enemy will spawn, and will 'seek' the target like it is supposed to do.
Sometimes, it will spawn and just sit there and not perform the task, and when I look up the behavior tree, the 'seek' task is considered success, which is wrong since the target is still not within reach ( enemy just spawned, I don't know if that's a refresh bug or something )

issueBE.JPG

What could I do to solve this issue ?

Thanks !
 
I would place a breakpoint within Seek.OnUpdate while it is returning success when you don't think that it should be. This will give you an indication of why it is returning success.
 
Hi Justin !

yeah I actually did, from what I could see it is because the navMesh.remaining distance is returning 0, making the conditions in the Seek.OnUpdate() a success.

The target it is supposed to reach is definitely not around the agent so I can't understand why it would return a remaining distance of 0
 
Is the destination set correctly? This sounds like it's something going wrong with the NavMeshAgent calculation.
 
Yes the destination stays the same every time and does not change.
Sometimes I have to restart 2 or 3 times the scene ( just hitting the play button ) in order to get it to work.

Also i have multiple agents spawning into "waves", starting with 1 and then with 2 etc, if the first agent is having the bug, all the following ones that will spawn will get the exact same issue.

I am not really sure what to do, navmesh seems correct and is the same every time, I can't think of anything that is inducing this
 
Top