Interactable Object

Adds an Interaction Menu to any 3D GameObject. This component handles the UI logic when a player looks at or approaches an object.

Fields

Interaction States


Default
Invalid
Disabled
Label
                        

Code Example

Below is a standard implementation using MelonLoader.


using MelonLoader;
using UnityEngine;
using Il2CppScheduleOne.Interaction; // Needed For Interactable Objects
                        
public class MyClass : MelonMod
{
    // Set To 3D GameObject In Current Scene
    public GameObject myGameObject;

    // Called On Scene Load
    public override void OnSceneWasLoaded()
    {
        InteractableObject myInteractableObject = myGameObject.AddComponent(); // Adds An Interaction Menu To The Gameobject
        myInteractableObject.message = "Press E To Interact"; // Sets Message On Interaction Menu
    }
}