How do I test if a loop condition is met?

Achieving certain goals in blueprints requires a completely different mindset. Translating C++ into BPs will not be pretty, here’s the closest you (I) can get to the mentioned pseudo code that still makes sense for visual scripting:

I mean, I could ditch the Timeline and increase rotation every Tick (frame) manually but that would defeat the purpose of using BPs. And that’s the crux, you generally choose the best tool for the job - in BPs if you want something to last precisely .5s, you’d use a timeline or a timer. Using a Timeline requires adopting a very specific workflow - feeding that one node information it needs and, in this case, it’s event driven.

In the example above rather than doing float comparison and worrying about its precision, I just let the timeline do its magic, and once it has finished its job, I play it backwards.

In an ideal world, you do the heavy lifting in C++ and manage higher level code in blueprints.


For a ping-pong like movement, I’d normally do something like this (providing that’s all what’s needed):

Image from Gyazo