Casting in UMG

Hello,

I’m having problems casting into a UMG HUD.
My objective is get a X value from an AI character and display into the HUD.
I do with no problems with the player character, but when i’m doing with the AI, the HUD is not updating and I think is because of a bad casting. Doing some debug i verified the function i created (same as the player) is working fine and the only problem, like i said, is displaying the value into the UMG HUD.
So… what is the correct way to cast an AI in the Event Contruct of any UMG?

Thanks in adavance.

Casting should not be different, do it in the binding function. Can you post a pic of your blueprint?

Could be a bad reference? Double check that youre pulling the values from the correct place?

I solved my problem. After breaking my head with no success I decided to do the job using my game controller. It’s not like I have in mind but do the same.
Anyway, thanks for your help.

i would like to know where and how to set reference of UMG variable to cast it to other blueprint.
i tried several time and didnt work for me :frowning:

@SimonRail

What do you mean? You can’t cast something to a Blueprint that it isn’t, that will fail.

i want to cast a variable out of my UMG to my gamemode, how can i do that.
the only “get” from a cast object is “get gamemode” or “get character controller” etc…

GameState might be what you are looking for, instead of GameMode.

If something isn’t globally available, you can pass it as a function argument.