googlevr / gvr-unity-sdk

Google VR SDK for Unity
http://developers.google.com/vr/unity/
Other
2.71k stars 1.09k forks source link

Trigger problems #122

Closed FrankHermes closed 8 years ago

FrankHermes commented 8 years ago

I'm building a prototype for an app that involves looking at items coming from a distance towards the user. When the Gaze Input Module's cursor is on an item coming towards the user and the user taps (pulls the trigger on the Cardboard device), it's removed. The problem is, that on Android devices a tap on one item works as it should, but also the next item that's coming towards the user is getting hit as though it was tapped even though I'm only gazing at it without pulling the trigger.

I've tried using different Event Triggers on the oncoming prefabs but that doesn't make a difference. Switching the Tap is Trigger checkbox on the Cardboard object sort of reverses the problem: then I have to tap every item twice for it to register a hit (instead of hitting two items with one tap). Also quite annoying.

Is this a known issue? Am I doing something wrong? I use Unity 5.2.3p1 and Cardboard SDK 0.5.2. I see this happen with the SDK's DemoScene too.

(And sorry for crossposting, my http://stackoverflow.com/q/34021746/224734 question did not get many views so I'm trying here)

smdol commented 8 years ago

If you can explain how to spot it in the DemoScene, I'll look for it and try to fix it. Did you change anything in that scene?

FrankHermes commented 8 years ago

I've created a new project (in Unity 5.2.3p1, on a Mac running El Capitan) to try and reproduce it for you as simple as possible. Imported the unitypackages for the Cardboard SDK and the Cardboard Demo. Open the DemoScene. Don't touch anything. When I run it on the Samsung Galaxy S3 that I have here (running Android 4.1.2), in my Cardboard V2 (one with this mechanism that triggers screen taps) I have to tap each cube twice before it teleports. And if I switch the setting on the CardboardMain gameObject to "Tap Is Trigger", I can make the cube teleport again, after I've tapped it only once, as long as it teleports close enough to its original location for me to find it quickly. I haven't tried this on iOS yet because building a test version for iOS is such a hassle, so I don't know if this is purely Android related.

smdol commented 8 years ago

Ah OK. This problem is likely specific to Android, in fact just older Android (pre-4.4). Before then, there was no Immersive Mode, so we have to fake it. There could well be a bug in that code.

smdol commented 8 years ago

We found the bug, but it has not been fixed yet in the new release (we were past the deadline for new code). It is part of the code that fakes immersive mode in older Android versions.

FrankHermes commented 8 years ago

@smdol Good news! Can you tell me what to fix, if it's possible to fix it manually in the current version?

smdol commented 8 years ago

It's not fixable in the current release unless you are up for decompiling a .jar and hacking on the java code.

smdol commented 8 years ago

Closing this bug, since we dropped support for pre-KitKat versions of Android, so we don't fake immersive mode anymore. And TapIsTrigger has also been removed.