A dial that can be rotated and can be snapped at multiple rotations, and is synchronised between multiple users in the same session.
This component uses Unity's standard HingeJoint component to restrict movement, unlike the Easy Dial. These limits are based around Unity's physics system. Physics are also used to move the dial so we can achieve a more realistic movement.
For an overview of how our SDK deals with interactions, please see Interaction Overview.
When a VR user's hand comes in close proximity to the dial, they can pull the trigger on the controller to initiate interaction. The hand will disappear, but when they move or rotate the controller, the dial will rotate around the configured axes. Synchronisation is achieved via messages that are sent to all users in a session. The SDK takes care of this so no need to set any of this up.
If you require your object to snap onto particular rotations (like an "on" or "off" position), please see Snapping for an overview and how to set it up.
Dial also supports reactions, which allows logic operations to be integrated on various state changes, like start of interaction, or when snapped to snap targets. See Reactions and interaction logic for more information.
Immerse SDK Class Library
More detail in
- Select a new GameObject.
- Reset the Position, Rotation and Scale of the Object. Ensure Position is set to <0, 0, 0>
- Edit the
- Set the Anchor to 0, 0 ,0 - it will not update correctly otherwise
- Make sure the correct Rotation axis is selected (Unity uses a vector component to represent this. There should be a 1 on that axis component that should be used for rotation and a 0 on all the others)
- If you want to restrict rotation (not use full 360 degrees), then tick the Use Limits box, and specify a min and max angle (in degrees). Negative angles are supported.
- Set Sync Values to Rotation
- Add one or more colliders to the GameObject - This is used to detect the closest interactive object to the controller
If the dial is not moving when you pull the trigger, check the following things:
- Is the Hinge joint set up correctly? Check the rotation axes corresponds to the scene orientation. For instance, if the green arrow is the axes you want to rotate around, only the y component of the Rotation Axes property on Hinge Joint should have a 1 in, the x and z components should be 0.
- Are Limits set up correctly? Check the min and max angles. For instance, -90 and 90 is a 180 degree rotation relative to the rest position set up in the scene
- Do you have a collider on your GameObject? This is necessary for the SDK to detect engagement and for the Rigidbody to work.
Note: When a collider is missing, you will not see the hand disappear when the trigger is pulled.
- Do you have duplicate scene indices? You can check this on the Scene Object .
- Do you have another collider near that might prevent movement/rotation?
- Check if any requirements are set up, and are they all met (they should all be green when in play mode in the Editor Inspector).
|When enabled, this component instance will log verbosely to the console (only in the Editor). This is useful for debugging, but can have a detrimental effect on the framerate as verbose logging sometimes logs every frame.|
|The object's unique index - this will be automatically set by the SDK and should not be edited.|
|Reference to the TransformSync that Dial is attached to.|
If this is not set (default setting), then the SDK will look for the TransformSync on the same object.
|Only after a second hand is engaged will the dial move.|
|Only after a second hand is engaged will the dial unsnap.|
|How to treat physics after the player lets go of the object.|
|A set of requirements that need to be met to allow interaction; can be used to disable the object until a particular state is reached. See Interaction Requirements for more details.|
|How easily the dial moves.|
|This property controls what controller movements make the dial rotate.|
When enabled, moving the hand in a circular motion rotates the dial. This is similar to a wheel with a handle on it.
When disabled, a wrist action moves the dial.
|A dial's value is a floating point number between 0..1. If you use limits, then the SDK will take that into account. If you set |
|Usually when interaction starts, we keep movement relative to the location where the controller was. If you place a reference to a child transform in here, we will use this instead to calculate relative movement.|
Try out this component in the Examples project
Examples (menu) > Interactions > Load Dial Example
Updated 4 months ago