First VR experiment: IndexOutOfRangeException: Array index is out of range.

Hey guys,

I’m trying to learn abit of unity vr development and I was following a guide in this link:

I followed everything to the letter but for some reason i’m getting the following exception once I start the game:

IndexOutOfRangeException: Array index
is out of range.
SteamVR_Controller.Input (Int32
deviceIndex) (at
Assets/SteamVR/Scripts/SteamVR_Controller.cs:151)
flying.Update () (at
Assets/flying.cs:16)

Could anyone help me with this ? :slight_smile:

Thanks for the help all but I have already found a solution on my own. Apparently Unity 5.6 doesn’t support SteamVR and it’s a known bug (that is not gonna be fixed for some reason :S) so downgrading to 5.5 solved the problem.

Well, have a look at Assets/flying.cs, line 16, there’s apparently an array called at a [number] larger than the array.length … Have not seen the video, but that’s where the error is at least from the log, hope it helps somehow - debug.log the array length just before, see what is called, the error is somewhere there :slight_smile: