The FSM I have checks for the closest tagged object, checks if it is in sight and then moves towards it and eats it. If there are no tagged objects, it goes to an idle state.
The sight checking and eating are performed by other FSMs.
When I debug this, it works fine. If there is more than one tagged object, it eats them all in order exactly as it should. When there are none left, it returns to the idle state.
However, when played without breaks, it moves to and eats the first one, but for some reason goes through the find closest check (when there aren't any) and gets stuck on the move state, because there's nothing to move towards. Here are two screencasts of the debug working correctly and the normal play not.
https://www.flickr.com/photos/120865053@N02/14103972679/https://www.flickr.com/photos/120865053@N02/14104114787/Also (attached) an image of the find closest check state, which is where I'm guessing the problem lies.
To clarify this particular state, I need more than one tag attached to an object and have been doing this with a child object which is empty except for a collider and the extra tag. So once it's found an object, it gets its parent object, then acts on it or sends it to idle if it returns null.