Document toolboxDocument toolbox

2021.1.1124.2 Rotary Switch



Overview

The Rotary Switch is a component that simulates a physical control switch.

The Rotary Switch only works in runtime.


Where to find

The Rotary switch can be found under Standard Components > Rotary Switch > Add Physical component.

This will add the Rotary Switch component to the currently selected object or create a new empty GameObject with the component attached if no objects are selected. If there is no Wheel Joint present on the object it will also be added.

The Rotary Switch must be placed as a child of a Kinematic Controller in the hierarchy.


Feature layout - Physical Component

Live Data

 

Selected State

The current switch state and its ID of the Rotary Switch.

Properties

 

Wheel Joint

The Wheel Joint used in conjunction with the Rotary Switch.

ID

The ID of the switch state.

Name

The Name of the switch state.

Lower Weight

Determines in combination with the previous state’s Upper Weight where the transition between the two states occurs.

Position

The Position of the Wheel Joint for the Switch State to activate.

Upper Weight

Determines in combination with the nexst state’s Lower Weight where the transition between the two states occurs.

On Selected()

Executes all actions in this box when the switch state is selected.

Runtime Only

This setting must be set to Runtime Only.

Object

The object which you wish to change when this switch state is activated.

On Unselected()

Executes all actions in this box when the switch state is unselected.

Save current position as state

Creates a new switch state based on the rotation of the Wheel Joint.

Use Scene Gizmo

When checked the gizmo is displayed in the scene view. The color of the gizmo can be changed with the colorfield after the checkbox.

Control Panel

 

Generate Control Panel

Creates a Control panel for the Rotary Switch.

Feature layout - Control Panel

Title

The Title of the Control Panel.

Click to ping the target component in the hierarchy.

Double click to edit.

DCMotor Properties

 

State

Shows whether the Color Sensor is currently active and thus whether it will detect colors.

Output Signal

Shows what color the ColorSensor currently detects. If no color is detected, it will return its Void Color.

Enable/Disable

Enables/Disables the Color Sensor.

Target Component

 

Target Gameobject

The gameobject which has a standardcomponent you want the Control Panel for.

Target Component

The Component which for which a Control Panel is generated.


How to use

  1. Create a new switch state and define its values.

  1. Add an action to a switch state.

  1. Add another switch state so it is possible to change between switch states. (This switch state does not need to have action added to it.)

  1. Test if the actions are executed in runtime.


Prespective Documentation