Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Controller Analog Stick Drift with Windows Mixed Reality Controllers & SteamVR - a code fix!

Discussion in 'VR' started by ROBYER1, May 3, 2019.

  1. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,450
    Just sharing this information for any other developers who notice the analog sticks on Windows Mixed Reality controllers not sitting at 0.

    We needed to clamp (deadzone) our analog stick values to prevent the drift from happening, hopefully a future firmware fix will come for this though. This isn't just exclusive to steamvr either,

    Find an example below of where we take the absolute value and clamp it if it is +/- 0.13

    Credit goes to Whitway Studios who gave us this tip on the Steam Community Forums
    https://steamcommunity.com/app/719950/discussions/0/1700542968202115701/?ctp=3

    Code (CSharp):
    1.                 float rightx = touchPadVector.x;
    2.                 if(Mathf.Abs(rightx) <= 0.13)
    3.                 {
    4.                     rightx = 0;
    5.                 }
     
    lazylukey likes this.