← Back to Devlog List
INTERACTION CODE May 28, 2026

DreamLoop Devlog #2: Tap-Based Interaction & Distance Validations

Written by Sami Uysal

Interactive elements form the core of DreamLoop. Players tap lamps, clocks, and other dream props to mutate their states. However, we quickly noticed a gameplay bug: testers could tap and open a door from the opposite side of the screen without walking to it. This bypassed key gravity puzzles entirely!

To fix this, we implemented a proximity check system in C#. When a tap event is fired, the script performs a 2D raycast from the camera to the tapped position. If the hit object implements our IInteractable interface, the code computes the distance vector between the Player transform and the Interactable transform. If the distance exceeds our threshold (e.g., 2.5 units), the interaction is rejected with a minor visual vibration feedback on the object, guiding the player to walk closer before interacting.