Can't call character functions in widget

Hello, I’m creating a widget that calls a function from the character. It should display another widget with custom properties. But when I run the game it only shows a plain widget (with no custom properties) and I’ve found, that the casting fails every time. Does anybody know what the problem is? Thanks in advance

Is ‘player’ class actually a pawn? If it inherits from the pawn class you need to use ‘get player pawn’ not player character. If it inherits from an actor base class then you will need other methods to get the appropriate reference. Check out video #1 and #25 in the link below for a more in depth explanation of what I mean.

The casting now works properly. Thanks for the solution