How to set variable in PlayerController from UserWidget?

I’m making analog of PvZ game, and now i’m stuck at making working for user interface. So i have a button (User Widget)

And after pressing button i want to change variable in Player Controller, where i will compute closest TargetPoint to mouse and wait for a mouse click

so,after mouse click i will create plant on closest to mouse target point.
But how i can access PlayerController variable from User Widget?

Hello Rusbaron,

I would suggesting Getting a reference to the player controller (Get Player Controller) and then casting in order to get a reference to any variable that you would like to alter. I have provided a link to documentation that explains casting. I hope that this information helps.

Link: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/CastNodes/

Make it a great day

Thks!It works!