Display Camera Setting In Game?

Hi there,

I have a question regarding the User Interface.
I want to display the current settings of the player-pawn camera on the UI widget and somehow cant figure out how to get the variable like focal length linked in the UI widget blueprint.
Can someone please help me out?:slight_smile:

Thanks so much

There are many ways to do that, here’s one:


There’s more to it, of course - you may want to also update widget as the camera settings are altered run-time.

Hi there!
Thats, great. Would you mind giving me a solution for a camera setting being updated in viewport widget in game mode? I’ve set a keyboard button to make the camera cycle between different focal lenght values. I just need to show the current focal lenght in the viewport.
Thank you!

The widget is created in the Game Mode?

I’ve set a keyboard button

Which BP handles input?

camera cycle between different focal lenght values

Where’s the camera? In a possessed Pawn? Somewhere else?


Too many unknowns atm.

1 Like

Ok sorry, I’m new to blueprints.

The widget is created in the Game Mode?
This is the graph for the widget. Zoom is a text block set to Variable.
That’s where the lens focal lenght should appear.


It’s set to be shown in game mode. This code is in my Pawn event graph, like this:

Sorry about the mess. I just don’t know how to trigger / connect the UpdateZoom event.
This is the code for Cycle the lenses, also inside my Pawn event graph.

Where’s the camera? In a possessed Pawn? Yes, it’s inside Pawn’s blueprint.

MAny thanks!

I guess I’ve messed things up watching different tutorials, and trying to make it work.
Right now, the widget only shows initial focal length, obviously, because I can’t connect the updated focal length value to the UpdateZoom node.

This is, sadly, very confusing. We need to know where things are in order to connect them and make them talk.


  • above, you want to set the widget visibility in the Game Mode (how are you doing it?) but created the widget in the Pawn? Is that correct?

I just need to show the current focal lenght in the viewport.

  • what does this mean? Do you mean to update a text box inside a widget and have it display focal length?

If all of this is inside the Pawn, what is the actual issue you’re having?

Connect those and you’re done. Or create a custom event that sets text and have both the Begin Play and input call that event.

It worked! God, I really need to get into blueprints.
It worked just fine, by connecting both ends of the Cycle Lens code to SetText function, like you said.
I’m not sure if I could clean up the code and make it better, but anyway.
Thank you so much for your time. Sorry about the newbie question.
Cheers!

1 Like