A slider that can be moved along a straight line (restricted on a "rail"), and is synchronised between multiple users in the same session.
For an overview of how the Immerse SDK deals with interactions, please see Interaction Overview.
Sliders make use of snapping. Understand this concept before reading on
Slider uses physics (a Rigidbody and a Collider ) to enable interaction. When a VR user's hand comes in close proximity to an object, pulling the controller trigger will start the interaction. The user's hand will disappear, but moving or rotating the controller will cause the object to move and rotate accordingly. Synchronisation is achieved via messages that are sent to all users in a session.
Slider also supports reactions, which allows logic operations to be integrated on various state changes, such as "start of interaction", or when snapped to particular snap targets. See Reactions and interaction logic for more information.
Immerse SDK Class Library
More detail in ImmerseSDK.Interaction.Slider class
- Select a new GameObject.
- Reset the Position, Rotation and Scale of the Object. Ensure Position is set to <0, 0, 0>
- Set Sync Values to Position. This will sync only the position.
- Add one or more colliders to the GameObject - This is used to detect the closest interactive object to the controller
If the slider does not move when the trigger is pulled, check the following:
- Is there a collider on the GameObject? This is necessary for the SDK to detect engagement and for the Rigidbody to work.
Note: When a collider is missing, the user's hand will not disappear when the trigger is pulled.
- Are there duplicate scene indices? This can be checked on the Scene Object
- Is there another collider near that might prevent movement/rotation?
- Are interactions correctly 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 TransformSymc that object is attached to.|
If this is not set (default), then the SDK will look for the TransformSync on the same object.
|Only after a second hand is engaged will the object move.|
|Only after a second hand is engaged will the object unsnap.|
|How to treat physics after the player let 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.|
|The valid direction of movement. All other axis and any rotation will be restricted.|
Valid choices are:
PosX : The X axis (red)
PosY : The Y axis (green)
PosZ : The Z axis (blue)
NegX : The negative X axis (red)
NegY : The negative Y axis (green)
NegZ : The negative Z axis (blue)
In the picture above, the Slider has the red axis pointing along the axis of movement, so the Axis setting should be PosX
|The minimum value for the axis specified in |
|The maximum value for the axis specified in |
|True to invert the value of the slider.|
|How quickly the slider moves.|
Updated 4 months ago