threlte logo
@threlte/xr

useController

Provides a reference to a current XRController, filtered by handedness.

<script>
  import { useController } from '@threlte/xr'

  const leftController = useController('left')
  const rightController = useController('right')
  const gazeController = useController('gaze')
</script>

Signature

// CurrentWritable<XRController | undefined> - The current XRController
const controller = useController('left')