add-interactivity

Implement pointer, proximity, trigger-area, and raycast interactions for Decentraland SDK7 entities.

1|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/stom66/dcl-bowling --skill add-interactivity-stom66
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: add-interactivity
Source: https://github.com/stom66/dcl-bowling/tree/main/agent/skills/add-interactivity
Command: npx skills add https://github.com/stom66/dcl-bowling --skill add-interactivity-stom66

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @dcl/sdk, and includes references (resource) components.

What problem does it solve? Decentraland scene developers need to make entities respond to players — clicks, hover highlights, E/F key presses, zone entry detection, and ray-hit detection — but the SDK7 interaction APIs have subtle pitfalls (collider layer masks, skinned-mesh clickability, handler re-registration bugs, counterintuitive trigger callback fields) that cause silent failures. ## Core Features & Use Cases - Pointer & Proximity Events: Add click, hover, and nearby-button-press handlers via pointerEventsSystem, with correct collider setup (MeshCollider, GltfContainer collision masks) and feedback options (hoverText, showFeedback, showHighlight). - Trigger Areas: Detect players or entities entering/exiting volumes with TriggerArea and triggerAreaEventsSystem, including collider-layer filtering and local-player guards for multiplayer. - Raycasting & Global Input: Cast rays in four direction modes via raycastSystem or the Raycast component, poll key states with inputSystem, and read cursor/pointer-lock state. - Use Case: A player walks up to a door in your scene and presses E to open it without aiming — use onProximityDown with maxPlayerDistance and a Tween rotation, following the verified proximity-door pattern. ## Quick Start Ask the AI to make a specific entity in your Decentraland scene clickable with hover text, or to detect when the player enters a zone, and it will apply the correct SDK7 interaction pattern.

Frequently Asked Questions about add-interactivity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make an entity clickable in Decentraland SDK7?▼

Use pointerEventsSystem.onPointerDown with the entity, a button like InputAction.IA_PRIMARY, and hoverText. The entity needs a collider on ColliderLayer.CL_POINTER — add MeshCollider.setBox(entity) or set visibleMeshesCollisionMask on its GltfContainer.

How to detect when a player enters an area in Decentraland?▼

Create an entity with TriggerArea.setBox or setSphere, size it via Transform.scale, and register triggerAreaEventsSystem.onTriggerEnter. Filter to the local player by checking result.trigger?.entity !== engine.PlayerEntity.

Why is my GltfContainer model not clickable in SDK7?▼

GltfContainer defaults visibleMeshesCollisionMask to 0, so visible meshes are not clickable. Set visibleMeshesCollisionMask: ColliderLayer.CL_POINTER for static meshes; for skinned or rigged models, add an invisible child MeshCollider box on CL_POINTER instead.

Why does my pointer click handler fire multiple times?▼

Re-registering onPointerDown from inside its own callback re-inserts the handler into the event map during iteration, causing repeat fires. Register once at creation and mutate the PointerEvents component in place to change hoverText dynamically.

What is the difference between pointer events and proximity events?▼

Pointer events require aiming the cursor at the entity via raycast, while proximity events trigger when the player is nearby and roughly facing the entity, using maxPlayerDistance. Pointer interactions always take priority when both apply.

Does raycasting in Decentraland return the closest hit?▼

Not necessarily. RaycastQueryType.RQT_HIT_FIRST returns the first hit in range, which may not be the closest. Use RQT_QUERY_ALL and sort hits by distance when you need the nearest intersection.