Can you set an actor reference within a widget blueprint?

Can you set an actor reference within a widget blueprint? I am using an actor reference within a widget blueprint and it sees the available actors as well, however I cannot assign them. Is there another work around to this? (the end goal is for level designers to set the possible destinations to teleport to themselves without going into blueprints)

330487-screenshot-2021-02-23-000038.png

330488-untitled.png

Sort of yes and no. Use GetAllActorsOfClass to find the teleport locations and let the user choose one. But you can’t really store stuff in a widget because they only exist while they’re on screen.

So when the user chooses a destination, you need to assign it to somewhere useful, like another actor, or the game instance.

1 Like

What about using a structure? Example: I have a widget which I can open up with Right Mouse Button. In this widget is a button which teleports the player to a target location. The target location or target locations are stored in a structure.
Third Person Character: Teleport1 posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4

Here you have to create a reference to your widget. (Mine is Teleport_HUD_Ref) All you can see is just added to the event graph.

Teleport Widget:

Here you have to create a reference to your Third Person Character, editable and exposed on spawn. This way you can link it in your Third Person Character as shown in my pictures. All you can see is in the event graph. Widget has just one button.

Teleport Structure:

Just some coordinates you can choose from or create a list in a widget …
You could even create 3 text fields for x,y and z coordinates in the widget where you could enter your preferred coordinates, make a vector and plug this vector in the target location.