New Interaction System

Introduction to JU Interaction System

With the new interaction system, it is possible to dynamically interact with the scenario and create interactive props like buttons and light switches.

To see how to use the system as in the GIF below, see the Interaction System demo scene and read the next topics.

JU Interaction System

This script controls the character's interaction system and checks for interactable triggers.

This script must be attached to the player.

Variable
Description

Use Default Inputs

Enables the default input configuration.

Inputs

Reference to the player input asset used for interactions.

Layer

Layer mask to detect interactable objects.

Avoid Obstacles

Defines whether obstacles block interaction checks.

Check Range

Distance range to search for interactable objects.

Auto Check

Enables automatic checking for interactables.

Auto Check Interval

Time interval between automatic interaction checks.

Interaction Enabled

Defines whether the interaction system is active.

On Interact

Unity Event triggered when interacting with an interactable object.

JU General Interactable

This script is used to create various interactive objects, allowing you to easily call functions via Unity Events.

The gameobject with this script must have an "Interactable" tag and a Collider with "IsTrigger" enabled.

Variable
Description

Interaction Enabled

Defines whether the interaction is enabled or not.

Interact Message

Message displayed when interacting with the object.

On Interact

Unity Event triggered on interaction.

Is Toggle

Defines if the object acts as a toggle switch.

Toggle On_Interact Message

Message displayed when the toggle is turned on.

Toggle Off_Interact Message

Message displayed when the toggle is turned off.

Toggle On Event

Unity Event executed when the toggle is activated.

Toggle Off Event

Unity Event executed when the toggle is deactivated.

Is Toggle On

Define toggle state

JU Vehicle Interactable

This script works for the character to be able to enter a vehicle, this script must be attached to a trigger that is a child of a vehicle gameobject and with the "Interactable" tag.

JU Vehicle Interactable

This script is actually a base class for all interactables; if you attach it to a game object alone, nothing will happen. This base class has virtual functions that can be overridden to create logic for a unique interactable.

Last updated