Skip to content

Toggle Controls

Toggle Controls

Enables or disable player input controls.

Properties

System

Name Explanation Type
Is Enabled Whether the player controls are enabled. When set to false, the player cannot move or interact until controls are re-enabled. Switch or Value

Examples

Disable Player Controls

This disables all player input controls, preventing the player from moving or interacting.

toggle_controls(false);
{"Data":{"IsEnabled":{"IsGlobalSwitch":false,"IsLocalSwitch":false,"IsValue":true,"SwitchIndex":0,"Value":false,"Metadata":null},"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Flow.ToggleControlsCommand"}

Enable Player Controls

This re-enables all player input controls, allowing the player to move and interact again.

toggle_controls(true);
{"Data":{"IsEnabled":{"IsGlobalSwitch":false,"IsLocalSwitch":false,"IsValue":true,"SwitchIndex":0,"Value":true,"Metadata":null},"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Flow.ToggleControlsCommand"}

Toggle Controls Based on a Global Switch

This sets player controls to the value of Global Switch 0, allowing dynamic control toggling.

toggle_controls($gs[0]);
{"Data":{"IsEnabled":{"IsGlobalSwitch":true,"IsLocalSwitch":false,"IsValue":false,"SwitchIndex":0,"Value":false,"Metadata":null},"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Flow.ToggleControlsCommand"}