|Name of gadget||Switch|
|Section||Sensors & Input|
|Number of Tweak pages||1|
|Last updated||21 Feb 2019 [Beta]|
This gadget is primarily used to switch things on and off in edit mode without having to go back into the menus (note that the switch is not available nor visible to players when Dream Surfing). You can define what the values of on and off are so you might use it as a very simple selector that toggles between two values. It is particularly useful for debugging purposes during game development where you can turn gadgets on and off that you do or do not need (for example pitch darkness or infinite lives) when you want to test something.
Example Tutorial (from Media Molecule)
- Stamp a cube.
- Stamp a switch.
- Tweak the cube, go to physical properties and connect the on/off output of the switch to the visible input on the cube.
- Now if you use the switch the cube will appear and disappear.
- Switch Colour
You can change the colour of the switch here. The input can dynamically change the colour, while the output will send a signal that can be used to colour other objects the same as the switch.
This determines the state of the switch, whether it is initially on or off. The input can be used to toggle the state of the switch for debugging purposes. The output sends the “On Value” or the “Off Value” depending on the current state.
- Off Value
Here you can define the switch’s “On/Off” output when it is toggled to the off position.
- On Value
Here you can define the switch’s “On/Off” output when it is toggled to the on position.
This toggle determines whether the switch is visible to you while shaping your scene. Switches that are in microchips, currently selected or have tweak menus open will remain visible, otherwise to see a switch with this setting off it is necessary to set your “Show/Hide” settings to include “Preview Invisibility”.
If the switch is visible, you can toggle it on and off just by clicking on it, no need to go into the tweak menus.
This turns the whole gadget (not the switch!) on or off (while off, there will be no outputs at all).