Wednesday, October 21, 2015

Input Delay Bug in Unity3D (editor and standalone)

Unity3D is nice. It is very nice, but it does still have a few bugs in it and these can be costly. Usually in terms of time and frustration. Any programmer knows this frustration and the best way to get past it is to solve the bug. easier said than done of course, and doubly bad when it is someone else's bug.

I have been very frustrated these past few weeks due to the Editor and the built game running on my PC suffering from an Input delay bug. It was random, though occurred about 80% of the time, it also varied in intensity from half a second to about 3 seconds. When I loaded a new scene in my game it could be worse or better.. there seemed no rhyme nor reason for it.

I tried many times to solve this problem, researching all manner of sentences in Google trying to find someone else with an answer. I did find several people with the problem, or something very similar (though mildly different). None had an answer for me that worked, and to be honest, some of the answers were unlikely to work anyway. Like a fevered man, I tried them all anyway!

Yesterday I had a bit of time to kill and so once more tread into the Bing search engine. Then unleashing several creative concoctions I call pseudo sentences to  find why the Input is lagged, or delayed. I got lucky, I found 'AngryMuppet' had posted the exact same issue, and somehow had also found an answer I could try.
http://forum.unity3d.com/threads/unity-5-1-input-delay-when-running-in-editor.332581/

This is the problem he pointed out:-
If you have 'Virtual reality Supported' ticked in the standalone platform

So I tried it (ok, it took me a while to find the option to turn it off).. You can find it here:-
Edit->Project Settings->Player->OtherSettings->Virtual Reality Supported

Mine was checked, and my hope began to rise. I unchecked this option and click the play button on my game. Wham it came up fast (faster than it has recently), and when I clicked the buttons and controlled the Rabbit around the screen there was NO LAG.... My hope was now very high, but I was not convinced, I have seen it run ok before. So I ran from one scene to another several times and it was all solid. Then I stopped the game and played it a couple of more times, till I was finally convinced the BUG was Stomped!

My Hope had now been replaced with a sense of relief and contentment.

I do not know why this bug exists, but there it is. Input lag of seconds was due to supporting this feature in some way.

I sincerely hope that anyone looking to solve this issue them selves stumble upon this blog post and solve their issues as well.

Thanks AngryMuppet,
Da Voodoochief

No comments:

Post a Comment