I've had a bug in my game that I was unable to figure out for months. Today I managed to, (or so it seems), get to the bottom of it. However, I still don't understand why the change I made works. I was hoping someone could bring to light why this change works.
The issue: A sprite is set to visible in a function, and then a function below this action is called and checks if this sprite is visible. AKA:
Call first function: set sprite visible (within first function then call second function which checks if sprite is visible)
This image was how I managed to solve (works so far) the issue. Instead of placing the check if sprite is visible nested in the top of the function, placing it as a sub event beneath the top of the function with NO other change allows it to work. There are no actions in the top part of the function that precede this conditional check and thus the ONLY difference is placing it within the functions start or below as a sub event. Did I miss something in the manual that makes note of this, is it most likely a timing issue, are conditions placed within the top of the function ran a tick earlier?
Just trying to improve my understanding of the engine.
Thank you for your time,