I built a subGraph in Unity Visual Scripting to move a GameObject ("returnThisGameObject") from its current location (Point A) to its originalPosition (Point B).
The code run dozen of times a minute and usually does its job. But sometimes the GameObject doesn't move the full distance, and just stops part of the way there. The While loop in the subgraph doesn't finish in those cases, as subsequent graphs after this one do not run.
I could hack it so that the While loop only runs a certain number of frames before moving on. But I'm trying to figure out the root cause of why the While loop doesn't always work. I am not very familiar with Smooth Damp (or LERP) though, so I could use some guidance.
Any ideas why this While Loop isn't always completing?
EDIT: As suggested, I added a variable for objectVelocity and plugged it into the Smooth Damp node on both sides. Still encountering the issue where the GameObject doesn't always make it all the way to Point B...