ViveSoftware / ViveInputUtility-Unity

A toolkit that helps developing/prototyping VR apps.
http://u3d.as/uF7
Other
352 stars 82 forks source link

Input Does Not Work in Steam Release #157

Closed CodingJar closed 4 years ago

CodingJar commented 4 years ago

I've been using VIU for close to a year now. Yesterday I went to update the game. I tested everything and released as usual. Once on Steam, I launched the game and the input doesn't work. I launch my game via executable in the Unity build directory and everything works. It's almost like there's some kind of Steam change that is intercepting the Vive wand inputs when run through Steam. Any ideas? The log files are nearly identical when run through test vs. steam (with the exception that I'm using Steamworks.NET plug-in so that the Steam input doesn't die). I've updated all plug-ins: VIU is at 1.10.6 SteamVR is at v1.2.3 (I tried the latest and reverted thinking the actions bindings were the cause of the issue) Steamworks.NET 13.0.0

This has been brutal to debug -- I've tried everything I can think of (on hour 5 right now). Any help is appreciated. The game I'm working on is here: https://store.steampowered.com/app/971340/Orc_Towers_VR/. The Beta branch is the update and the release branch is on the old (working) version.

chengnay commented 4 years ago

@CodingJar Could you try using SteamVR Plugin v2.2.0 before Steam moves the binding files to StreamingAssets/SteamVR/ folder.

After you launch your game(Steam), could you go to SteamVR>Devices>Controller Settings>Choose your application under "Edit Controller Bindings" and check whether your bindings are correctly set.

CodingJar commented 4 years ago

Hello Chengnay,

Thanks for this tip. I do not use the action binding system, I do not allow players to rebind keys as the interactions are simple trigger / hold dpad. However, downgrading did indeed help for a single level. Unfortunately there appears to be a bug in SteamVR Plugin v2.2.0 that I managed to track down. In SteamVR_Behaviour.cs this needs to be applied, or the DontDestroyOnLoad never gets called:

                if (steamVRObject == null)
                {
                    GameObject objectInstance = new GameObject("[SteamVR]");
                    _instance = objectInstance.AddComponent<SteamVR_Behaviour>();
                    _instance.steamvr_render = objectInstance.AddComponent<SteamVR_Render>();
            behaviourInstance = _instance; // CodingJar critical fix or you lose input after reloading a level!
                }

So you've helped me and everything works now! Thanks!