๐Ÿ‘‰Interactions

Creating interactions with world objects and between players

You can setup Interactions on Actor Blueprints and MMLs, which can then be triggered in-game.

There are two main ways to interact with objects in the world

  • Walk within the Interaction Range of the object, look at it to Target it, then F to interact

  • Hover over the object with your mouse, click to walk to the object and automatically interact

Actor Component

Attach this M2_Interactable Actor component to an Actor to make it interactable. The Display Name will be shown in a nameplate when interacting with the object. You can also specify the Range within which interaction is possible, visualized by the corresponding sphere collider. The Highlightable flag determines if the object will have an outline shown around it when looking at/hovering over it.โ€‹

In the Options map, you can specify the different interactions for your object. When you provide more than one option, interacting with the object will open a list where the desired option can be picked.

Adding interactions

After attaching an Interactable Component, in its Options map we add a generic M2 Interaction Button Option. We can specify a Prompt to show for this option, and optionally an ID as the value's Key to differentiate between multiple interactions.

To trigger functionality on our new interaction, we implement the OnButtonOptionRequested event from the Interactable Component. This event will be triggered whenever the interaction option is clicked (or on interaction, if it is the only option). The Option Id specifies the Name of the option that was triggered, while the Interaction Instigator is the Actor that triggered the option. This could be any Actor, but in the case of a player, it will be their Morpheus Actor.

As an example, we want to launch upward the Character who triggered our interaction. GetRenderTargetFromActor ensures we've got a Render Target (our Character), which we can then use for the remaining logic.

Last updated