I'm basically trying to create a laser that, via a while loop, extends or retracts instantly based on whether or not it's touching a solid. I believe that's a simple raycast.
Why does the above cause an infinite loop and freeze the game? I've tried stopping the loop if the ray is > 320 height or < 1 height, but that doesn't help either.
Develop games in your browser. Powerful, performant & highly capable.
"while" by itself has no conditions so it will always be true, add "end loop" to your actions
Ah. So having the while loop in a parent condition was the problem, but simply ending the loop after each action just negates the loop. Solved by not using sub-events, and instead multiple normal events with their own while loops.