Search Unity

Question How to get the location of controller in XR Interaction Toolkit?

Discussion in 'XR Interaction Toolkit and Input' started by xue-xue-xue, Jan 16, 2022.

  1. xue-xue-xue

    xue-xue-xue

    Joined:
    Sep 8, 2021
    Posts:
    4
    Hi, I am new to Unity and C#, but have some programming experience, I followed some youtube videos set up the XR Interaction Toolkit successfully and make it running on my Oculus Quest.

    I also attached scripts to the controller and see some output and even setup button click with message successfully.

    I want to know once I have the

    Code (CSharp):
    1. ActionBasedController controller;
    or

    Code (CSharp):
    1. XRIDefaultInputActions controller;
    How can I get the controller's world coordinate system or rotation?

    Or if there's some documents or tutorials that I can look for this?

    Thanks.
     
  2. xue-xue-xue

    xue-xue-xue

    Joined:
    Sep 8, 2021
    Posts:
    4
    OK, I think I got it solved, with auto-complete working, I think I can get information from the

    Code (CSharp):
    1. controller.transform;
    will test it later.
     
  3. acemon2006

    acemon2006

    Joined:
    Apr 26, 2022
    Posts:
    1
    please tell me this worked
     
  4. xue-xue-xue

    xue-xue-xue

    Joined:
    Sep 8, 2021
    Posts:
    4
    it works