Button widget

hello,
Please help me, i am beginner in unreal engine 4.
i want to make a widget with some buttons.
at press a specific button, it will increment an score.

I did a blueprint bat i have a errors. :frowning:

thank you for help

Where is the Total Puncte variable coming from? It looks like it’s coming from your third person character blueprint, so if it is, you need to use a cast to get it. Right now you’re trying to set a nonexistent Total Puncte variable inside of the widget blueprint. Add a Get Player Character node and cast it to ThirdPersonCharacter. Plug the “As ThirdPersonCharacter” into the Target of both of the Total Puncte nodes. Should ix your problem.

Also worth mentioning, if you package your game, Print Text won’t show. Only in the editor. I’d recommend adding text to the widget and updating that instead.

Each blueprint is an element in the game world.

Each element has a set of properties (functions and variables).

An element can access his own properties but can’t access others’ unless he has a “reference” to another element.

In your case, you want your HUD to have a reference to your Third Person Character which has your “TotalPunctle” property (variable).

There are several ways to get a reference to something, in your case my best guess would be : GetOwningPlayer (it will return a Controller), get the pin out of this and GetControlledPawn (it will return a Pawn), get the pin and plug it into a “Cast to Third Person Character” node.

The ‘cast to’ node will give you an output pin referencing your Third Person Character blueprint.