๐Ÿ‘‰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.

The resulting example interactable

Live Config

Interaction.UseNewInteractionSystem

Enabled by default. Disabling this will revert to the unsupported and soon to be deprecated legacy version of this system.

Interaction.UseFocusCamMode

When enabled, any object that has the M2_FocusCameraComponent is able to be made the main focus of a user's screen when interacted with.

Disabling this means that interaction will not be available.

Interaction.DoesSingleOptionBypassMenu

When set to true, an interactable with only a single interaction option will by default bypass the interaction menu upon interaction and will immediately trigger the sole interaction option. This can be overridden for individual objects/options

Interaction.NameplateBehaviour.HideWhileInteracting

When set to true, nameplates will be hidden while an interaction is ongoing.

CausesFreezeWhileInteracting to be ignored if true (as there are no nameplates to freeze).

Interaction.NameplateBehaviour.FreezeWhileInteracting

When set to true, Interactable nameplates will not respond to updates from targeting strategy while an interaction is ongoing, ie. if your targeting strategy selects 'looked at' objects and you:

  • Look at object A and interact

  • Look at object B.

IfFreezeWhileInteracting is false then Object B's nameplate will display, if true then Object A's nameplate will display.

Only takes effect if HideWhileInteracting is false.

Interaction.NameplateBehaviour.UseOverheadNameplateMode

When enabled the Nameplate of the object you are targeting is displayed over the object itself, instead of the default behaviour of displaying the name above the Quickbar.

Last updated