Interaction System
The interaction system handles bush hiding, log hiding, and glowcap pickups — core survival mechanics.
Interaction Types
Bush Hiding
- Player enters bush proximity prompt
- Camera animates into bush with ripple motion (10 studs/sec)
- Bush becomes semi-transparent
- Player is hidden from PathMonster (8-stud kill radius check skips hidden players)
- Exit: Any movement input triggers exit with sound effect
Log Hiding
- Uses
HidePositionattachments on log models - Player snaps to log's axis alignment
- Proximity prompts placed at log ends for natural entry
- Exit: Direction-aware repositioning along log's
RightVector
Glowcap Pickup
- Clones tool from
ReplicatedStorageinto player backpack - Proximity prompt on glowcap mesh
- Single-use per instance
Client-Server Flow
Client: ProximityPrompt triggered
→ interaction-controller sends request with:
- interactionType ("hideInBush", "hideInLog", "pickUpGlowCap")
- interactionTargetPath (instance path)
- targetPositionX/Y/Z (for duplicate name resolution)
→ Server: interaction-service resolves Instance
→ Server verifies position (1-stud tolerance)
→ Returns { success: boolean }
→ Client applies visual effects
Position-Based Resolution
Multiple instances can share the same name in the hierarchy. The server resolves the correct target by matching the client-reported position with a 1-stud tolerance, preventing spoofing while handling network imprecision.
Key Files
| File | Purpose |
|---|---|
interaction-controller.ts | Client-side prompt handling, camera animation, exit logic |
interaction-service.ts | Server-side verification and state management |
chunk-remotes.ts | interaction request-response remote |