SteamVR_Controller does not exist

Following the HTC Vive Tutorial for Unity i got an error on this part
// 1
private SteamVR_TrackedObject trackedObj;
// 2
private SteamVR_Controller.Device Controller
{
get { return SteamVR_Controller.Input((int)trackedObj.index); }
}

void Awake()
{
    trackedObj = GetComponent<SteamVR_TrackedObject>();
}

Where it says “The name ‘SteamVR_Controller’ does not exist in the current context”
I can find no documentation and after a bit of googling the only fix i found was to change the execution order and or looking for the controller.cs script but this script does not exist at all, I have reimported the SteamVR asset package but still no controller script.

@blackdragonbe Can you please help with this when you get a chance? Thank you - much appreciated! :]

@swemonkey

According to this forum post, the problem seems to occur when upgrading to SteamVR 2.0 from SteamVR 1.X.

SteamVR 2.0 isn’t fully backwards compatible and changed some things that break projects all over the place. More specifically, they changed the input system, so all input code that has been used before is now as good as useless.

The Vive tutorial was written before SteamVR 2.0 was released and as such only supports SteamVR 1.2.X. Unfortunately there’s no easy way of using an older version, so we’re in a bit of a pickle.
I’ll see to it that the Vive tutorial gets updated to SteamVR 2.0 as soon as possible.
In the meantime, check out the examples that SteamVR 2.0 comes with, I hear they’re quite a bit better than in the first version.

Cheers,
Eric

This topic was automatically closed after 166 days. New replies are no longer allowed.