Search Unity

Question 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:
    147
  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.