Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity wants to learn about your experiences working on a Unity project today. We'd like to hear from you via this survey.
    Dismiss Notice
  3. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  4. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  5. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Help Wanted Extend / Change XRController.cs

Discussion in 'XR Interaction Toolkit and Input' started by Mr_Jigs, Oct 15, 2020.

  1. Mr_Jigs

    Mr_Jigs

    Joined:
    Apr 18, 2015
    Posts:
    69
    I'm using Unity 2019.4.11f1, XR Interaction Toolkit 0.9.4 with a Vive tracker.
    Using the XR Interaction Debugger I can see that the position and rotation data that comes in does not match Unity space and needs adjusting. I can do that by editing the XRController script in the package by correcting the values coming from devicePosition and deviceRotation in the UpdateTrackingInput method.

    However as soon as Unity is restarted my changes are gone and I have to edit the script all over again. I can't extend the XRController script because the UpdateTrackingInput is not defined as virtual and I can't change it because those changes would be lost for the same reasons as my other modifications get lost.

    There are suggestions that I should create a copy of XRController.cs in my own Assets folder as this should take priority over the Packaged version. I have tried that but it does not work for me.

    Any suggestions?
     
  2. FakeByte

    FakeByte

    Joined:
    Dec 8, 2015
    Posts:
    145
  3. Mr_Jigs

    Mr_Jigs

    Joined:
    Apr 18, 2015
    Posts:
    69
    Thanks for that. It took some searching to get it to work. Following this #18 seems to have worked. Changes to the files are now persisting over stopping and starting Unity.
     
    ttw1993 likes this.
unityunity