2023.1.1294.2 Rotary Encoder
Overview
The Rotary Encoder is a component that simulates a physical encoder.
Where to find
The Rotary Encoder can be found under Standard Components > Rotary Encoder > Add Physical Component
It will automatically be attached to a selected GameObject. Otherwise it will create a new GameObject to attach to.
A Wheel Joint will be created automatically as part of the component.
Feature overview - Physical Component
Live Data |
|
---|---|
Value | Current value of the Rotary Encoder |
Properties |
|
Wheel Joint | Assign the Wheel Joint you wish to use for the Rotary Encoder. |
Value Per Rotation | The value difference for a full rotation on the Wheel Joint. |
Base Value | The minimum value at zero position. |
Enable Rounding | Enables rounding the output to certain intervals. |
Cap Value | Enables the use of a minimum and maximum value. |
Minimum Value | The minimum value of the output value |
Maximum Value | The maximum value of the output value |
On Value Changed () | UnityEvent that is fired as soon as the output value changes. |
Control Panel |
|
Generate Control Panel | Create a Control Panel for this component. |
Feature overview - Control Panel
Title | The Title of the Control Panel. Click to ping the target component in the hierarchy. Double click to edit. |
Linear Encoder Properties |
|
Value | Current value of the Linear Encoder |
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
Create a Rotary Encoder and setup its Wheel Joint.
Add a Kinematics Controller, this can be found under Mechanics > Kinematics > Add Kinematics Controller to a seperate GameObject. Make sure the Rotary Encoder is parented under the Kinematic Controller in the Hierarchy.
Set the desired settings for the Rotary Encoder.
Enter PlayMode and test whether the Rotary Encoder works.
Prespective Documentation