Public instance variables not in scope when they are?

Let me explain a bit of my game:

In my game, there is a wall asset which toggles visibility and collision together randomly when the player stops looking at it. This is to create a sense of “Did I hallucinate that wall?”

When the wall toggles, it sets a boolean value that I access in the level blueprint for a few scripted events. I have made sure this variable has been set as publically visible as it possibly can… I think:

The issue is, I was having some problems with my scripted events. When I was looking for the problem, I thought it might be a good idea to watch the value of the boolean I was referencing in the level blueprint’s event graph. Despite it being super duper public, the event graph refuses to acknowledge it as being in scope:

29308-bug2.png

It turned out that my problems were unrelated, but this sent me in circles for a while. I’m not entirely sure this is a bug or not, but I thought I’d point it out.

Hi ,

It looks like you are not casting to the object containing your “Is Visible” variable or doing a “get all actors of class” and pulling the variable from there, For this case I would use a “cast to” node to cast to the “HalWall” object, and then from the cast get the “Is Visible” boolean.

Strange that it still works then. But thank you! This will make things go smoother.

I often get variables not in scope that get passed and actually work, but the editor keep saying there are errors and that I’m getting “none” from them. I’m pretty sure there is a problem with the editor. The variables are there, and the values I’m getting are the correct ones too. I made a macro that gets variables directly from a “cast to” the actor I need. Still variables show as “out of scope”.