Can't Use Character Variable from a Widget

Hello. I want to set my character variable in a user widget blueprint and then call it back on level blueprint but I just can’t.

I set the variable as in the picture but when I call it on level bp, it doesn’t work.

Thank you.


Have you confirmed that the cast to TopDownCharacter is succeeding? Also, what event do you have triggering this execution chain?

No, I want to know why it is not succeeding.

Can anyone help me?

Is top down character spawned in level during game? Try using print string to see if cast fails.can you tell what branch node is connected to? Try using get player pawn instead of get player character. Check if game is not paused.

pawn didn’t do it either.

string returns true but branch does not work. I am trying to make a main menu and my player hits “start”, I am crying to get some widgets on screen and enable controller but there is something wrong with casting-variable.

is your character moving without the widget? and the game started boolean as true by default?

have you added the navigation mesh bound volume?

yes, how is it about nav mesh? Character’s variable does not get true when its casted on widget.

with DisableInput node.

with EventBeginPlay, I add menu widget to screen and the character is standing still at somewhere in the map with no input. when player hits the button, screen shows the character but I can’t enable input and I can’t show other widgets because of the unread variable.

No my game is not like that. I have Nav Mesh and moves with W,A,S,D.

You can move normaly, that variable is the problem. Somehow engine does not read it.

Game is close to be finished, I’m making menus now and this problem pop up.

Thank you.

In another widget I can use character’s variable (health for example) but in menu widget, I can’t use the boolean variable.

you are using topdowncharacter available in starter content pack right? how are you disabling its input? you have set its controller to top down right?

the umg is spawned and character is spawned at beginning right? if not, when?

i have added a topdowncharacter and without any nav mesh it did not moved in a blank level ,in its example it moves with nav mesh bound volume .try adding that if you have not (it is supposed to move wherever you click,right?)

i have reproduced your problem i guess, looking for solution

works for mouse input check if it works for you ,variable changes.
widget blueprint

level setup


it does not work. string read ‘true’ after I press menu button but in the level blueprint, after branch true part does not work.

I am setting it at Start Button on Main Menu. Then, when its true i am adding some widgets to viewport on other blueprints.

noup it doesn’t set false either, I tried.

can you tell me where all (in total and for what) you are using that game started variable? (right click on games started then search/show references)