My favorite feature is the universal “Use” function, which is an easy way to interact with other objects/things in the environment. Using a blueprint interface BPI_Interface, we defined a generic function that can be used across multiple actors.

tidy002.webp

Untitled

This looks at your sphere overlap, and sends a generic message to all overlapping actors. See the sphere in the viewport here.

Untitled

This way the Player can interact with doors, switches, etc.

See how the door is activated with the event “Use” and also “UseAsPlayer”. Which simply means the player can activate it. “Use” is called from a BP_Interactable switch or any weapon etc defined later. It’s just a way to differentiate them. This just prevents players from walking up to a trap, and disabling it. Only “Use” will disable it, “Use as Player” will not.

Untitled

Taking a look at the BP_Interactable Button, you can see this Actor defines the event “Use” and fires, which toggles the button on and off. Additionally, the button itself fires a “Use” to any objects it is tied to with it’s public variable “Actors to Activate”.

Untitled

How To Create New Interactions

This is where the Use function is specified. Can add new functions here too.

2023-09-26 19_30_32-TP_Tidy_StarterTemplate - Unreal Editor.png

Add BPI_Interface to ANY actor.

2023-09-26 19_32_27-BP_Door.png

Then to actually create the event itself, select the “Override” button (Hover over “Functions” if you can’t see it).

2023-09-26 19_38_13-BP_Projectile.png