Immerse

Description

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.

How it works

📘

Sliders make use of snapping. Understand this concept before reading on

ASlider 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

How to implement

  1. Select a new GameObject.
  • Reset the Position, Rotation and Scale of the Object. Ensure Position is set to <0, 0, 0>
  • Add Rigidbody component
  • Add TransformSync component
  • Set Sync Values to Position. This will sync only the position.
  • Add Slider component
  • Add one or more colliders to the GameObject - This is used to detect the closest interactive object to the controller

Common Issues

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).

Slider with a positive X axis of movement

Unity Editor Component

Options

PropertyDescription
Verbose Logging Enabled
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.
IndexThe object's unique index - this will be automatically set by the SDK and should not be edited.
TransformSyncReference 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.
Requires Two handsOnly after a second hand is engaged will the object move.
Requires Two hands for unsnappingOnly after a second hand is engaged will the object unsnap.
Is Kinematic After EngageHow to treat physics after the player let go of the object.
Interaction RequirementsA 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.
Movement AxisThe 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
MinThe minimum value for the axis specified in Movement Axis
MaxThe maximum value for the axis specified in Movement Axis
Invert directionTrue to invert the value of the slider.
SensitivityHow quickly the slider moves.

Movement Axis values

Updated 4 months ago


Slider


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.