Skip to main content

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 HidePosition attachments 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 ReplicatedStorage into 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

FilePurpose
interaction-controller.tsClient-side prompt handling, camera animation, exit logic
interaction-service.tsServer-side verification and state management
chunk-remotes.tsinteraction request-response remote