Passing value from HUD BP to a variable in Pawn BP


I’m having hard time to understand a very basic procedure in UE4, how to pass variables between blueprints. I have a “SpaceInnerCamera” pawn where I control the movement of the pawn (camera) during game play. I am using a “HUD_selection” variable to choose between different HUDs. In each HUD blueprint there are few buttons and the idea is to interact between different HUDs by clicking those buttons. The HUD is selected based on an integer value whis is changed based on pressed button (each button sets dirrefent value to this same integer variable). The problem is that I don’t know how to set the integer that is located in pawn BP by clicking a button in HUD BP? Please see the attached picture.


if you want your pawns to have access to HUD variables, you must access them from player controller.

use get player controller then get hud then cast to your hud then you can have access to hud’s variables.

those variables must be public

Original guestion was other way around but I got it working… Thanks for your support!! :slight_smile: