Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
  • Help Room /
avatar image
1
Question by Pflobus · Aug 23, 2015 at 02:04 PM · androidvrnot workingtouchscreen

Touch detecting not working with Google Cardboard.

I wrote a script to make it so that the screen can be tapped for the player to move forward. Without any of the Google Cardboard scripts, this worked perfectly fine. But when I tested the Input.GetMouseDown with the Google Cardboard, it didn't work. Any help would be greatly appreciated!

Comment
Add comment · Show 1
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 livingtech · Mar 01, 2016 at 09:44 PM 0
Share

I'm trying to get this working too. This post is from last August, so maybe the bug that dolims refers to below is fixed now..? I can't see any reference to it in the Cardboard release notes though.

In my case, I'd really like to have both tap and swipe. This is totally possible in iOS using gesture recognizers, but I'm pretty new to Unity, so don't really know the best way to go about it. Especially once you add the Cardboard API into the mix.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by dolims · Aug 31, 2015 at 03:47 AM

Set TapIsTrigger = false on the Cardboard.SDK object.

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
0

Answer by meta-meta · Sep 15, 2015 at 03:18 AM

@dolims any advice for capturing a drag? It seems setting TapIsTrigger to false will get a click, but Input.GetMouseButton(0) returns true only for 2 frames or so.

Comment
Add comment · Show 7 · 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 dolims · Sep 15, 2015 at 03:37 AM 0
Share

Hmm... If TapIsTrigger is false, then you should see the actual down and up events from screen touches, and you should not get the up event until you lift your finger (or the trigger on v2 Cardboard). If you are getting an up event right away, it sounds like TapIsTrigger is still true, or you are using the magnet? You can also try Input.touches and check the phase.

avatar image meta-meta dolims · Sep 16, 2015 at 08:45 PM 0
Share

No such luck.

 void Update() {
  Debug.Log("touch count: " + Input.touchCount);
  }

When TapIsTrigger is false, this will output "touch count: 1" for about 2 frames while my finger is touching the screen. Interestingly, if I touch with 2 fingers, I'll get "touch count: 2" for 2 frames then it'll go back to "touch count: 1". So swipe works but only for 2 fingers.

$$anonymous$$y goal is to be able to spin the camera around for situations when it's inconvenient to look around a full 360 degrees.

avatar image meta-meta dolims · Sep 18, 2015 at 11:08 AM 0
Share

No such luck...

  void Update() {
  Debug.Log("touch count: " + Input.touchCount);
  }

When TapIsTrigger = true, This code outputs "touch count: 0" in Logcat whether I have a finger on the screen or not.

When TapIsTrigger = false, I get "touch count: 1" for about 2 frames and then it goes back to 0.

Interestingly, if I touch the screen with a second finger, i'll get "touch count: 1" (after 2 frames of "touch count: 2" if TapIsTrigger = true) and I'm able to drag. It seems Cardboard is eating my first touch.

I am not using the magnet. $$anonymous$$y code works as expected when not in VR mode. What I'm trying to do though is to allow the user to spin the camera around with a swipe so that if they are using the app in a situation where turning all the way around is inconvenient, there's still a way to see what's behind them.

avatar image dolims meta-meta · Sep 19, 2015 at 05:54 AM 0
Share

Found a bug in the SD$$anonymous$$ (the Java part). It'll have to be fixed in an upco$$anonymous$$g release.

Show more comments
avatar image toonday · Jan 19, 2016 at 10:53 AM 0
Share

@dolims I have a similar problem, I just got the latest version of the sdk and the gaze input works on android, but click and drag does not work in the editor. I tried Setting TapIsTrigger = false on the Cardboard.SD$$anonymous$$ object but no luck. please help :'(

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.

Follow this Question

Answers Answers and Comments

30 People are following this question.

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

Related Questions

how to make dialog box and how can i scroll the text using UI GUI buttons in Android / Touch 0 Answers

How to play ambisonic sound files on android 1 Answer

Unity Daydream Preview - Raycast/camera alignment 1 Answer

Unity 3D UI Button Not Working When Touched (Mobile)? 1 Answer

When The Screen Is Touched Jump 0 Answers


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