Ai bug SOLVED by ALT-Tabbing??!

SOLVED! Answer 4 posts down.

I have a simple obstacle that my Ai has to jump over (a default scaled cube on the ground). I set up a collision box that, once entered, causes the Ai to jump. It’s hacky but it gets the job done as I couldn’t find another way to make it happen other than SUPER hacky “move here then jump” nav-links that just make the Ai look like bots. Anyway.

My Ai jumps over the obstacle and gets to me just fine. It jumps back when I jump back as well. But if I move fast enough it’ll actually just be up against the obstacle jumping and not moving forward. Mind you, it jumps 3x the height of the obstacle. The entire time it’s doing so the “Ai MoveTo” node is still firing off just fine so it should be moving toward me but it’s… not. I tried to simply push it forward along its forward axis but couldn’t get this to work either.

It’s now 2:30am and I haven’t figured this out.

**AND BEAT THIS: ** Whenever I open up Gyazo to try and show what’s happening the Ai IMMEDIATELY jumps over the obstacle properly. Without fail. I’ve tried this 5 times with a 100% reproduction rate. I’ve waited up to a minute and a half without it figuring it out. While experimenting I’ve figured out that these do it every time:

Clicking on Gyazo or any other program
Pressing ALT+Tab (Just pressing it to open up the task-switcher or w/e it’s called does it; no need to actually alt tab as the window still loses focus iirc)
HITTING EJECT does some weird ****. The Ai will actually move back and forth against my obstacle (not forward but left to right) and then within 1-2 jumps properly jump over it.

It’s not entirely clear to me here, but are you calling the AI MoveTo every tick? You should only need to call it once and let it do it’s thing to find the player. I’ve got mine behind a DoOnce that gets reset on success or failure from the AI MoveTo (For what I need with my own game logic right now).

Anyway, just something to try. If it IS being called every tick by your BP then it might just be getting overwhelmed and that’s why tabbing away or distracting the engine lets it focus better on the task at hand.

Just a thought. Hope you get this resolved.

I’ll check it out; I got to this point following the tutorial on either the Unreal Wiki or Unreal Documentation (pretty sure the doc) so I assumed that they wouldn’t teach me bad habits xD

No it doesn’t seem to work. I’ve been tinkering with it for a while with no hints at a resolution. I’ll continue and post if anything comes up but so far nothing’s solved by only calling it once. Same behavior as before.

Edit: Rewriting the Tasks; perhaps that’ll work? Doing it because they were poorly written in the tutorial; not doing it just to try to solve. Just like clean and proper code. Or in this case Blueprints.

Final Update: IT WORKED! AHAHAHAHAH IT WORKED!

Simple solution: Don’t write **** code and you won’t get **** bugs.
Proper solution: https://i.gyazo.com/2eb0fc9a686e719b888923c8861a894d.png
What that USED to look like: https://i.gyazo.com/16de8f99e939e626927a771c8088c579.png

Yeah. YEAH.

Awesome! Glad you got it! And much simpler than what you used to have, too.