I’m having an issue where a pawn that I’m making eventually stops moving, when it should be moving at all times. However it’ll begin moving again when it detects the player.
Currently its behaviour is; patrol > chase when it sees the player > go back to patrol if player is out of sight for 3 seconds. It was working fine yesterday and earlier today, however today I made an adjustment to its peripheral vision (upped from 45 to 60 degrees) and to the capsule component size (now a bit bigger) - that’s when this issue started happening. I must’ve accidentally done something else, because I’m not sure how my resizing of the capsule component would result in this happening (doesn’t appear to clip into anything when it gets stuck), same for the peripheral vision.
I added a few photos. I’m using the mannequin and its running animation as a placeholder for now - in the first photo he’s stuck even though he looks like he’s running.
I’m fairly new to game development so I’m sure I’m missing something obvious haha.
Thank you!
Hm… I’m not totally sure what the issue is, but here’s what I’d try in your shoes.
The GetRandomPointInNavigableRadius has two return values. The lower one, cryptically named Return Value, will tell you if the call was successful or not. Adding a branch and then a PrintString or DrawDebugSphere node on false will help make it clearer if it’s failing.
Similarly, AIMoveTo has an OnFail pin that’s not hooked up - so the execution has a chance of just stopping if the function doesn’t succeed.
3. You can check your Nav Mesh by selecting Show > Navigation. Combined with DrawDebugSphere at your target point, you might be able to spot weird areas in the Nav Mesh where things could be breaking down.
4. Finally, pressing F9 on a node will create a breakpoint that will pause the game when the node is run. This is a great way to see if nodes are actually being called or not. I don’t know if you’ve used breakpoints before or not - but they’re great, a standard in most every programming language, and will quickly pay back the time it takes to learn to use them.
I hope this was helpful, and good luck on your project!
In AIMoveTo, I hooked OnFail up to a MoveToRandomLocation (just like how OnSuccess is hooked up) - now things are working fine! Thank you a ton. I really appreciate the tips too.
As to why this issue started when it did and not sooner, I’m gonna assume I just didn’t play around with the AI enough yet to witness it break.