33. Restore controls after a special mode
An inspection or cinematic mode often changes several independent things: player input, pointer visibility, movement profile, GUI visibility and camera ownership. Make a small restore plan before adding the effect.
| Entering inspection | Leaving inspection |
|---|---|
| Disable player input if required. | Restore that input switch; other active locks can still apply. |
| Show the inspection GUI. | Hide the inspection GUI. |
| Activate the inspection camera. | Stop any orbit and activate the intended normal camera. |
| Hide or adapt the pointer deliberately. | Restore the intended pointer/device behavior. |
| Start any temporary sound/effect. | Stop the named channel/effect or let it finish safely. |
Set Runtime Controls Enabled controls the control-profile feature as a whole. Set Player Input Enabled controls the player-input switch. Hiding the mouse pointer controls its presentation. Those commands do different jobs; they are not interchangeable locks.
Use explicit enabled/disabled states for cleanup. Toggle is convenient for a repeatable switch, but calling a cleanup toggle twice can leave the feature in the wrong state. Track temporary modes with a variable when several exits share the same restoration logic.
Test Close, Escape/back, scene change, dialogue interruption and cutscene skip where those exits exist. A sequence that restores control only on its happy path can leave the player stuck.
