Search Unity

Resolved How to get notified of snap turn (perhaps other similar events)

Discussion in 'XR Interaction Toolkit and Input' started by stillwind, Mar 10, 2021.

  1. stillwind

    stillwind

    Joined:
    Jun 13, 2016
    Posts:
    13
    Hi,

    In the process of migrating to XR toolkit. I previously had a blink effect when the user made a snap turn and now I'm trying to replicate it, I expected to find an action/unity event on the snap turn provider, or somewhere, but I can't find anywhere to hook into to get notified when it happens.

    Looking at many posts, I wonder if it's that I need to do something with XRI bindings (but this seems too low level). Then I read mentioned in a post about TrackedPoseDriver, is this what I need?

    Thanks for any help.
    And generally, can someone point to where I can learn how to use XRI bindings, what they're for? And other topics like the TrackedPoseDriver...
     
  2. stillwind

    stillwind

    Joined:
    Jun 13, 2016
    Posts:
    13
    I figured out how to do this for anyone looking for a solution:
    Get hold of the InputActionReference the controller is using for turning, (eg. XRI LeftHand/Turn), and test its action.triggered bool. I found it works well because it just briefly gets set during update, only when the snap turn is happening.
    I probably would prefer to observe some kind of event rather than test this on update, but for now it's working.