Casting to character fails

I am trying to display a boss’ health on a widget, the boss’ health is set, yet the casting never receives it.

It fails because your casting the player character to the devil. So unless the player is the devil it will always fail. You nees to get a reference to the character your looking to cast to

How would I get a reference to the devil?

there are many ways to get the reference or to accomplish the same thing in a different way.

it depends on where your creating the widget and the setup your working with. for example if you were to create the widget from the devil itself then you could have a variable for the devil actor in the widget. then when you create the widget you can drag off the return value and set the variable, course using this method you could just set the health value directly if you wanted to.

you could also look to get the widget if its the only one of its type and set a variable in the widget that way. or you could set a variable with a reference to the devil from the game mode, game instance, or player. or you could use a get actor of class. or im sure you could probably use a blueprint interface or something similar too. there are many ways.

That worked! Thank you very much!