Custom Actions For Each Actor

Hello,

So my question is pretty simple. I’m wondering what are the basic steps necessary in order to have custom “actions” for various actors. So for example, we could have a Tree actor with a couple of options, say “Break off Branches” and “Cut Down”. Then for a Rock actor you could have only one option, “Mine”.

I’m relatively new to Unreal and have more experience working with Unity in the past. I’m able to read the documentation for myself but I suppose my issue is knowing what I need to know.

Presumably the first step would be creating a blueprint that would take in a list of “actions” from a given actor, before printing them out to what ever menu I have. Then I’d go about creating the various actors, adding the actions. But how would I add them? How would I pass a list of these actions (which varies in length and should be able to accept any number of actions) then to a blueprint?

TL;DR - Need to know the steps involved in creating an “action menu” which can take in any number of arbitrary actions, each with their corresponding effect in the game. Such as one item with “Pickup”, “Use”, “Examine” for available actions, and then another item with only “Turn On” as it’s available action.

Would this be something that would be done through the use of event dispatchers? If so how would I go about doing this? Would I create an event dispatcher for each event?

Let your Actors create a Widget themself. They also Add subwidgets (your Actions) and Bind to the Button Click events (premade dispatchers) just make sure you check the “Is Variable” inside UMG so you can access the various UMG Elements. That way your Actor will know what Button is pressed and can do whatever they like at that Point.

I assume this could be adopted so all the actions are listed under a single menu accessed by say “E”? Also, Thanks!

Sure. Your Actors can add as many Actions as you like. Simply add the to a Scrollbox so you dont go offscreen if you have a bazzilion Actions :stuck_out_tongue_winking_eye: you can also add more Actions from somewhere else. Aslong as you got a ref to your Widget.