Wrong infinite loop?

Hi,
Been searching a bit on the forums but i just wanted to know if either my logic, or the infinite loop treshold is wrong?

Basically i want to force my player to move until he reached a certain point so i’m doing something like this:

The map is looking like this:

I basically convert the exposed location into world coordinates, to compare them with the player position.
However, UE tells me it’s an infinite loop, but i’m unsure… why does this happen?

Thanks in advance for your help

Because that’s all executing on a single frame you wouldn’t actually get the result you want. While Loops, in blueprint, need at least a frame between checks or it will fail out as an infinite loop because it gets stuck at that point doing the same thing over and over in the single frame, incidently, I’ve never found a practical use case for one that I couldn’t achieve in a more blueprint friendly way.

I would suggest lerp the location using a timeline (or if you are feeling reckless you could use tick, but I wouldn’t) either way you need to add movement input every frame to get a smooth result.

I can see from your picture that you are replicating the end of mario where the game takes over movement and puts him in the castle, the other way you could achieve this, is with an animation montage, that has root motion enabled (admittedly, I can’t speak to whether that works for 2D), just for your consideration.

Oh i didn’t know while loop were executed inside a single frame !
I tried using lerp and timeline, stopping the timeline when my a>b check is actually completed, but it didn’t work for some reason, and the timeline only stopped when it was over, even when mario was way past the castle.

I’ll check into animation montage, thank you very much for you reply !

Also update, managed to animate it using a “Move Component To” node.
There’s a slight quirk as Mario flips around Z-Axis for no reason at some point, but that’s minor