Component image
KnobControl takes the local rotation of its slot around a specified axis and applies it proportionally to a floating point value.
Fields
Name | Type | Description |
---|---|---|
persistent
|
Bool | Determines whether or not this item will be saved to the server. |
UpdateOrder
|
Int | Controls the order in which this component is updated. |
Enabled
|
Bool | Controls whether or not this component is enabled. |
Target
|
IField`1<Float> | A field to set with the knob's value. |
Callback
|
Action`1<Float> | A delegate that is called with the knob's value change. |
RotationAxis
|
Float3 | The axis around which to measure the slot's local rotation. |
Rate
|
Float | The proportional effect of the knob, in values per full (360-degree) rotation. |
Min
|
Float | The minimum value for the knob. |
Max
|
Float | The maximum value for the knob. |
_lastRotation
|
Float | (internal, read-only) Used in determining the rotational change. |
_lastAxis
|
Float3 | (internal, read-only) Used if the RotationAxis changes. |
_lastUser
|
User | (internal, read-only) The user who last rotated the slot. |
Usage
As the local rotation of this component's slot changes, the knob's value is updated according to how much it has rotated about the RotationAxis. The amount the value changes is determined by the change in rotation (measured in fractions of a full rotation, so for example a change of one degree would be 1/360), multiplied by the Rate.
Note that the value field is not driven. This means it is synced to all users, and can be written to at any time.
This component is most useful when coupled with a Joint to restrict the slot's rotation to be only around the rotation axis.