Table of Contents

Interface IInteractable

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Interface for interactable objects in the scene, providing interaction logic and UI display properties. Used for NPCs, objects, and other entities that players can interact with.

public interface IInteractable : ISceneObject
Inherited Members

Properties

InteractRateLimit

Minimum milliseconds between interactions with this object from one character.

double InteractRateLimit { get; }

Property Value

double

Name

The name of the interactable object.

string Name { get; }

Property Value

string

OnInteractTriggers

ECA triggers invoked server-side when a player successfully interacts with this object. Configure these in the Inspector to define per-object interaction behaviour without code.

List<Trigger> OnInteractTriggers { get; }

Property Value

List<Trigger>

Title

The display title for the interactable, shown in the UI.

string Title { get; }

Property Value

string

TitleColor

The color of the title displayed for the interactable in the UI.

Color TitleColor { get; }

Property Value

Color

Transform

The transform of the interactable object in the scene.

Transform Transform { get; }

Property Value

Transform

Methods

CanInteract(IPlayerCharacter)

Returns true if the specified player character may interact with this object.

bool CanInteract(IPlayerCharacter character)

Parameters

character IPlayerCharacter

The player character attempting to interact.

Returns

bool

True if interaction is allowed, false otherwise.

Remarks

A pure question with no side effects. It used to stamp the character's interact rate-limit as part of answering, which made it unusable as a check: the scene server, the quest system and the client's input handler all call it, and each call silently consumed a limiter meant for one of the others. A quest accepted within the limiter's window of the interaction that opened the dialogue was refused by a debounce nobody intended to spend, and the refusal path sends nothing back — so the player saw a dead keypress. Spend the limiter explicitly with TryConsumeInteractRateLimit(IPlayerCharacter).

ExecuteOnInteract(EventData)

Fires all OnInteractTriggers with the provided event data. Called by FishMMO.Server.Implementation.World.SceneServer.Interactable.InteractableSystem after server-side validation succeeds.

bool ExecuteOnInteract(EventData eventData)

Parameters

eventData EventData

Context for this interaction (initiator, interactable reference, etc.).

Returns

bool

True when at least one trigger was fired.

InRange(Transform)

Returns true if the specified transform is within interaction range of this object.

bool InRange(Transform transform)

Parameters

transform Transform

The transform to check range against.

Returns

bool

True if in range, false otherwise.

TryConsumeInteractRateLimit(IPlayerCharacter)

Spends the character's interact rate-limit, returning false when it is still cooling.

bool TryConsumeInteractRateLimit(IPlayerCharacter character)

Parameters

character IPlayerCharacter

The interacting character.

Returns

bool

True when the limiter was free and has now been spent.

Remarks

Separate from CanInteract(IPlayerCharacter) so a caller that only needs to validate — the quest system, which already holds its own ingress guard — does not consume a budget belonging to the interaction path.