Sliding Doors & Hinge Rotators
NAMESPACEMyDreamGameStudio.InteractAnything
MENU PATHTutorials > Doors & Movers
COMPATIBILITYUnity 6.0+
DOC VERSION
This tutorial covers the core mechanical utilities of the framework. We will build a sliding sci-fi door using the Transform Mover, and a swinging physical door using the Hinge Rotator.
1. Sliding Door Setup (Transform Mover)
- Bring your sliding door model into the scene. Set its layer to
Interactionand add a Box Collider so player raycasts can successfully detect it. - Attach the
Interactable Targetscript to the door root and set the Interaction Type toToggle. - Attach the
Transform Movercomponent. Assign the specific moving mesh of the door to the target field. - Define your movement axis (e.g., X or Z), open distance, and slide speed. You can utilize the built-in path preview gizmo to visually verify the slide animation directly in the Scene view before hitting play.
- Link the
On Toggle OnandOn Toggle Offevents from the Interactable Target directly to the Mover's open and close functions.
2. Rotating Door Setup (Hinge Rotator)
- Select your rotatable door object and attach the
Hinge Rotatorcomponent. - Define the Open and Closed angles, the rotation axis (typically Y for standard doors), and the absolute Min/Max limits.
- Use the visual Scene gizmo to verify the swing arc. The component natively supports both mouse drag interactions (for heavy physical pulls) and smooth toggle transitions (for automatic swinging).