Hello, I’m really confused with public booleans, I had barely started learning unity when I switched to unreal and all I want to do is check a boolean in my menu UI blueprint from my menu level blueprint, I’ve looked it up and most answers are for different kinds of blueprints using cast to and referencing player objects, but I get errors when I do that. The only other solution included watching a 2 hour video essay about blueprint communication which I don’t want to do.
Can someone explain what cast to does and how to fix this like im stupid, cause i am.
First image is the UI blueprint that the boolean is located in
Second image is the Level blueprint that I want to check the boolean from.
Where is it created? Where the arrow is pointing? Could it be the Add to Viewport node hiding at the edge?
what cast to does
It’s a test + conversion. Here, you take an object reference of any type and test if it’s the object type that you want (you’re testing if the object you did not provide is a menu widget). If the test succeeds, the engine will allow you to use this object (as Menu) as if it was the object of the type you wanted.
This node in the middle is also casting:
We’re testing if the letter Q is an integer and then attempt to convert and use it as a digit. As you can imagine, this will not compute well. In both cases you need a value to test.
I think I understand, theres a full ss of the level blueprint, I’m not sure what Menu would inherit from though, MainMenu is attached to LevelSequenceActor but connecting that didn’t do anything.
From what I’ve been reading I’m under the impression that the boolean should be listed under the MainMenu variable, is it not working correctly or am I completely wrong?
The above is an example of an Event Dispatcher, this one is built into the button. Here, the button subscribes (bind) to a Custom Event and will execute said event when clicked. You can create it easier like this: