Hi, I have followed a tutorial on how to make a two way teleporter and it worked for a while but now it hits me with an infinite loop, something about delay calls. Please help.
I don’t see an infinite loop there, unless you teleport the actor back into the teleporter infinitely (if that triggers the collision check).
An infinite loop is a task that doesn’t finish within a single frame. Delay creates an async task over X time in the future (many frames), so the code past the delay node is not going to be the cause of an infinite loop. That’s not seen as an infinite loop even if looping, since it’s just a recurring task over multiple frames.
Try to use the binary method to delete your blueprint nodes until you find the node that causes the editor to report an error.
To clarify, I think you mean binary partitioning. Testing 50%, see if the error is in part A or B, then loop for the partition where the error remains (partition 50% of that again). That’s one way to reduce time to test the whole.
Likely you’d spend less time when simplifying the code to a bare minimum and test from there. (add a few nodes, see if it still works). Usually it wouldn’t work to just delete one half and test the other. (Code doesn’t just split in usable halfs most of the time, and the code environment remains complex where we want to test a simple task). When scanning some raw data binary partitioning can save tons of time, just doesn’t work for everything.
you’re setting JustTeleported ‘after’ the teleport
so my guess is you teleport from T1 into the teleport of T2 which sends you back to T1 which sends you back to T2 etc.
try setting the bool before the SetActorLocation
I fixed it, I think. I moved the Spawn reference a bit further to not get teleported right back in and even after a few tries it doesn’t pop up anymore. I also made the delay longer for caution.