Advanced Features
Last updated
Last updated
Support for Interactions will be ending soon. This system will remain usable for a while but MSquared advises that you implement your own system to avoid any disruption once support ends.
The basic functionality of the Interactable Component and the way other systems interact with it, can be modified using additional BP Interfaces that can be implemented on your interactable BPs.
Adding an M2 Interactable Options Interface to your object allows fine-tuning specific interaction behaviours through various optional interface functions, explained below.
When using Approachability to click on interactables and automatically navigate to and interact with them, the location the character walks to is picked based on physics traces and pathfinding around the interactable. With BPI Interaction Point Override, we can manually specify where the character should navigate to in order to interact with our object.
This can for example be used to make a character always approach an interactable the same way or make an object interactable from anywhere, incl. beyond interaction range (ie. Screen focus).
Add the interface in the BP's Class Settings
Functions available for implementation
Should Single Option Bypass Menu
By default, if there is only one interaction option on an interactable, it will instantly trigger this option instead of opening the list when interacted with.
This function allows overriding this functionality on a per-option basis.
Example use: an object where you always want a prompt before confirmation, ie. a vending machine with a varying amount of options.
Should Close Menu on Option Select
By default, the interaction list will stay on-screen after selecting an option.
This function allows overriding this functionality on a per-option basis.
Get No Options Available Text
Allows displaying prompt text when there are no interaction options available.
Get Interaction Option Display Details
Allows dynamically specifying the display name for individual options without changing them
Get Interaction Enabled State
Allows dynamically making interaction options disabled/hidden, optionally using the provided Interaction Instigator
.
Example use: locking or hiding a certain interactable/option from unauthorized players
Get Interaction Point
Tells Approachability Movement where to navigate the character to interact with this object. Player Character
is the character trying to navigate. Interaction Point
is our location override. When set to the character's current location, the character won't move but will interact on the spot. Success
can be set to true to apply the location override, or false to revert to the default behavior