Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

InteractProps

Property Type Default value Description
className? string undefined Classes on the prompt, merged over its own, so a game draws it in its own look, as Panel and Button take theirs.
distanceTolerance? number 0.05 Metres past the nearest Interact within which this one still competes for the player’s press, the one the character faces winning.
exclusive? boolean true Whether one press fires one Interact, the one the room chooses for the player; false shows its prompt and fires on the key whenever the character is near, beside the chosen one, as Roblox’s AlwaysShow.
onInteract? () => void undefined Fired on the interact action’s key while its prompt shows. Client behaviour, so a callback is allowed: it opens local UI, and the consequence is another behaviour’s data. Each press also emits InteractedEvent on the entity, which an NPC’s routine answers; in a room, on the room’s copy.
prompt string undefined Shown above the entity while the character’s body is near and it is the one Interact the player’s press fires.
radius? number 1.5 Metres from the entity within which the character’s body is near.
targets? TargetFilter TargetKind.ControlledCharacters Who may press it: kinds and layers add, teams and rules narrow. A kart the player drives presses it through the kart where its targets name every controlled entity.