Extension

Example (inherit from Interactable)

namespace SurvivalTemplatePro
{
    public class InteractableTest : Interactable
    {
        public override void OnInteract(ICharacter character)
        {
            base.OnInteract(character);

            // Do something when a character interacts with this.
            // e.g. press a button
        }

        public override void OnHoverStart(ICharacter character)
        {
            base.OnHoverStart(character);

            // Do something when a character starts looking at this object.
            // e.g. Enable outline effect
        }

        public override void OnHoverEnd(ICharacter character)
        {
            base.OnHoverEnd(character);

            // Do something when a character stops looking at this object.
            // e.g. Disable outline effect
        }
    }
}

Example (Implement the IInteractable interface)

Last updated

Was this helpful?