For the complete documentation index, see llms.txt. This page is also available as Markdown.

Interactables

An interact prompt near a world object

The Interactable Component

Interactable component fields in the inspector

Adding an Interactable component to an entity will automatically show UI when players are within the radius you specify.

The interaction radius scales with the entity's world scale, so keep the interactable root at scale 1 and scale a visual child when you want the interaction range to stay fixed.

To respond to the player pressing the interactable, you'll need to write CSL code.

An entity can have more than one Interactable. Use priority when multiple prompts might be available at the same time.

The most common pattern is:

  • Create a class that inherits from Interactable

  • Call this.set_listener(this) in ao_start

  • Implement can_use and on_interact on your class

If you add a new interactable class in code, you still need to add that component to an entity in the editor (or spawn an entity and add the component at runtime).

Trash Example

Grow Example

An interactable that “grows” an entity (once):

Prompt Purchase Example

An interactable that prompts a product purchase:

API Reference

Optional player hooks (global rules)

You can also implement these on your Player class to enforce game-wide rules (e.g. can't use interactables before respawning):

Last updated