• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
2
Question by Vitor Nexo · Mar 24, 2015 at 06:06 AM · androidinputtouch

Google Cardboard and touch

We are developing an Android VR application that has some touch interactions before we put the cellphone in the Cardboard.

From my understanding, the Cardboard SDK captures touch events and forwards them to Unity using another Android activity. On the first touch the status bar appears and the event is not forwarded to the application. If a second touch is performed while this status bar is visible, it is then sent to the application. Waiting some time hides the status bar, and then the same behavior occours as in the first touch.

Therefore I would like to know the following:

  1. Why does the status bar shows on touch when adding the Cardboard SDK? Is this a Cardboard Setting? Can it be disabled?

  2. Why does the touch event only work when this status bar is visible? Can they be always forwarded?

Edit: This is the single activity in the Android manifest:

 <activity android:name="com.google.vrtoolkit.cardboard.plugins.unity.UnityCardboardActivity" ... >
     ...
     <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
 </activity>
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Vitor Nexo · Mar 31, 2015 at 02:29 AM

It turns out Fibrum has an SDK as well which is compatible with touch, so we ended up using it to solve the problem.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
3

Answer by dolims · Mar 25, 2015 at 02:11 AM

If your phone's version of Android is older than 4.4 (API level 19, KitKat), then this is what happens, because Android did not add the "immersive" mode till then, which is what lets fullscreen apps receive touches without the status bar showing up first.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Vitor Nexo · Mar 25, 2015 at 12:33 PM 0
Share

Thank you for your answer @dolims. I am indeed using an older version of Android (4.1.2, API 16). However, we are able to hide the upper status bar (we are not interested in hiding the lower system bar), and receive touch events normally only when the Cardboard SD$$anonymous$$ is not in the project.

This is a weird behavior, because we are able to install third party VR applications in this same phone. They accept toch event normally, not requiring multiple taps to work, neither showing the system bar.

avatar image dolims · Mar 25, 2015 at 08:28 PM 0
Share

Do the other VR apps show the status bar or are they full screen? Could be that the Cardboard SD$$anonymous$$ is doing it wrong. Could you mention one of the 3rd party VR apps you referred to? I'd like to compare.

avatar image Vitor Nexo · Mar 25, 2015 at 08:45 PM 1
Share

They don't show the status bar. We tested some fibrum apps like roller coaster VR and Zobie Shooter VR

avatar image dolims · Mar 25, 2015 at 09:06 PM 0
Share

Thanks! I'll definitely look at those.

avatar image
2

Answer by Maksen · May 25, 2015 at 01:22 PM

Hello everyone! I solved this problem! You must install these settings when VR is not needed.

Cardboard script

CardBoard SDK

alt text

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image The_Devil · Jan 06, 2017 at 01:57 PM 0
Share

I am using the latest version of the SD$$anonymous$$ - Google VR SD$$anonymous$$ 1.1 and this "CarboardScript" is not present. I even went down the BaseVRDevice.cs and it has no function/variable corresponding to "Tap is Trigger". How do I accept physical touch on a button when in VR mode?

avatar image
0

Answer by Ice52 · Oct 11, 2015 at 12:36 PM

Following on from what @dolims said, I have been having the same problem with the latest version of the cardboard SDK with Android 4.3.

commenting the line:

 <meta-data android:name="IMMERSIVE_MODE" android:value="true"/>

in the AndroidManifest.xml found in the Plugins->Android folder appears to have solved the problem.

Thanks @dolims for pointing me in the right direction.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image EduardGames · Nov 19, 2015 at 10:11 AM 0
Share

it works for me

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

,How Do get Touch input to work with the Player Input Component 1 Answer

Touch Input positions are different on iOS and Android? 2 Answers

Android: Touch Input Timeout Issue 1 Answer

multi-touch woe, index out of bounds? 1 Answer

Differentiating between touches for multiple game objects. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges