What should I use? cast,event dispatchers or blueprint interface.

Hello, I’m new here. I’m learning how to use UE5 now, and I’m trying to create a simple ‘ring and run’ game using blueprints. My idea is to have a few buttons on the screen, and by clicking a button, it can make the camera move to the door and ring the bell. Clicking another button will make the camera come back. I have already created a Widget Blueprint and put two buttons on it, and it works when I click them. I have also created a pawn and added a camera component to it. Now, I’m trying to connect these two blueprints so that when I click the button, the camera will move forward.

I tried casting, but it seems like they are not sharing the same parent class, so it failed. I also tried Blueprint Interface and Event Dispatcher, but it just doesn’t work as the tutorials I watched.

Is there an easy way to make it work, or what is missing when I use Blueprint Interface or Event Dispatcher?

Sorry, my English is not very good. Any help will be appreciated.

1 Like

Which blueprint creates the widget?

Is a widget blueprint form user interface.
Maybe I should use a actor blueprint and put both of the camera and buttons inside?

That’s not what I was asking - I know it’s a user interface widget.

Which blueprint creates the widget?

Where do you create it? In which blueprint do you create, reference and add it to the viewport?

Assuming the widget is created in the actor that owns the camera component:

Above, clicking a UI button shifts the camera.


Buttons already come with delegates that handle clicks so dispatching it would work OK. This can be done in many ways, with an Interface, too. But, as you can see above, casting, creating a dedicated communication interface or additional event dispatchers may not even be necessary.

Oh,sorry for my misunderstanding.
I created the widget in the level blueprint following a YouTube tutorial. I can post the link here if necessary.

Either create the widget in the blueprint with the camera component. Or bind them from the LB / widget,

You’ve provided little to no info about the actor with the camera so it’s impossible to be more precise. Here I’ve assumed it’s a game character that we possess and communicate with:

The above can be also done inside the widget in the very same way.


Consider providing much more details about the setup if the above is not enough.

Thanks for the help!
I created the widget in the Playerpawn blueprint, and it works!

I’m sorry for not providing enough info because I’m essentially creating this game by combining all the tutorials that I’ve watched, so I don’t know how to explain it well.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.