Using a Variable from another Blueprint

Can anyone explain how to change Booleans in other blueprints for Unreal Engine 5? I just want to move a camera up 30 degrees when you hit a button on the UI. So tracking a Variable from the Blueprint Camera from a Button on the UI.

The eye icon is open for the IsMainCameraRotating, so it is visible to other scripts.

Hey @UpsideDeimos! Welcome to the forums!

Communication between actors and even UI is covered pretty extensively in our documentation! I grabbed the page for you, give this a read! :slight_smile:

1 Like

I went through the documentation and it looked like I needed Direct Actor Communication, however after I added an Object Reference Variable and also fixed my Set Variable it now throws a “Accessed None trying to read property Menu_Camera_Rotate” error. I set all variables to Instance Editable and Expose on Spawn.

Okay! That’s progress!

So you’re getting an NRE(Null Reference Exception). Variables cannot be empty when called upon.

The thing is the error is 100% context based, so… bring pictures, they’ll do a lot of the job :slight_smile: I can’t really tell you anything to help because I don’t know what “Menu_Camera_Rotate” is, where it’s being called, why, etc.


Here is the first.


Here is the second.

So it looks like you aren’t actually setting that reference to Menu_Camera_Rotate! You need to tell the widget blueprint which one in the scene you are referring to, as there could be so many. If there is only going to be one in the scene, you can try using a “GetActorOfClass” on the Construct event, and seeking out that BP_Menu_Camera_Rotate and setting your “Menu_Camera_Rotate” as that!

Because the variable you created is like a pocket to hold a very specific shape, but you have to put something IN the pocket for it to know what specific item to communicate with! :slight_smile:

1 Like

It works perfectly now. Thank you kindly for your assistance.

1 Like