How to get the input from the widget in an actor in the world triggered by a pawn.

Hey, This for some reason broke my brain.

I have a pawn. It has a widget interaction component.

It triggers the button in a widget that’s inside an actor in world space, It prints great.

However, what’s the reference path to get that input to now do something in my pawn?

Thanks.

You should pass the pawn reference to the widget. To do this, just grab the widget from the WidgetComponent and set a ref, so you can easily call any functions from the pawn whenever you need to.

Sweet, this sounds easy.

I apologise But im rather slow on the uptake of things.

So the widget needs the pawn reference, nice.

Are we taking the widget from the widget component list in the actor itself and setting it?

Or do we reference in the widget?

In the actor i set a variable to the pawn, and made it editable. then connected it in the level blueprint.
Then used this, to get that pawn reference to the widget?

Am I close?

It looks to be correct. You can create a function in the Pawn, and when you click the button, check if the Pawn reference is valid, then call the function from there.

This works fantastically, and beautifully I had the references already there for something else so It worked great.

Thank you!