How to call PlayerController functions from UMG

I want to simply activate this function in my player controller:

I figured Set Timer by Event would be the best way to do this. Alternatively, I could just set a bool on and off depending on button press or release and then query it every tick. I’d rather go with the prior option.

I created a reference to the player controller in the UMG widget, but I can’t seem to access the event delegate so I can use it in the timer so I tried this:

It appears to work great in multplayer, but I get these errors:

Are these errors something I should worry about? Is my approach to this problem incorrect?

Widgets already have an internal reference to the player controller owning them.
You don’t need custom reference (GPlayerControllerReference), use node GetOwningPlayer instead, and cast it to your custom PC class to call your function.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.