Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by sharmoni · Jun 06, 2010 at 04:20 AM · errorinputtouchoffsetfinger

touch input error - finger position offset

At various random times the remote will not track fingers correctly and will offset the input by as much as an inch. This happens when running by app in Unity and after building it to my iPad (and previously to my iPhone).

I've been having this trouble since I started programing with Unity over a year and a half ago and I keep thinking it must be something I'm doing wrong (though I suppose it's possible that it's a bug). I'm running the latest release version of Unity, SDK, and Snow Leopard.

Usually I can fix it by quitting Unity and restarting. However, it happens often enough that I may have to quite Unity every time I run my app. It usually follows a code update, but I haven't noticed a pattern as to what JavaScript is affecting it.

I could live with this, annoying as it is, but now I can't get my builds to work, even when the app works with the remote. I've spent the last 2 hours continually quitting Unity, opening it, building my app, installing it, finding out it is still not registering my finger touch under by finger, but about and inch away, and starting the process over.

Comment
Add comment · Show 3
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 spinaljack · Jun 06, 2010 at 06:39 AM 0
Share

Have you considered making a calibration scene on your game to let player set their own controls and touch position? It's possible that not all devices are the same and it'd fix your offset problem.

avatar image sharmoni · Jun 13, 2010 at 04:25 AM 0
Share

I'm only going to build for the iPad, so that eli$$anonymous$$ates platform variences. I think it's an issue of why the raycast isn't registering my finger correctly. Here's the relevant code [sorry,I can't find any code block setting in the comment input]:

touch = iPhoneInput.GetTouch(0); var ray = Camera.main.ScreenPointToRay(touch.position); var hit : RaycastHit; if (Physics.Raycast(ray, hit) { hitObject = hit.transform.gameObject; }

avatar image sharmoni · Jun 13, 2010 at 04:36 AM 0
Share

I have been able to get it working and each time the last thing I tried was changing the iPhoneSettings.screenOrientation. The previous time it worked (after I posted the question) I changed it to Landscape. This time (after leaving my comment) I changed it to to Portrait then back to Landscape and finally back to Portrait before it worked. (The orientation setting doesn't affect my game, which is oriented by turning the iPad, as you would with a printed boardgame, so I don't have any reason to choose one orientation over the other.)

2 Replies

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

Answer by sharmoni · Aug 07, 2010 at 10:52 PM

Well, as far as I can tell I solved this. Because my camera was continually changing position it was freaking out the raycast. I was getting too many readings. I resolved it by moving the Physics.Raycast part of the script to the script that was moving the camera. So every time the camera moved it would recast the ray.

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 sharmoni · Jul 17, 2010 at 10:45 PM

Ok, looks like I sorted this one out. I was using my main camera to register taps on objects. That camera is on a joint so it swings around above the board to match the tilt of the iPad. The camera position was offsetting the raycast. Once I had a static camera to use for my GUI buttons, I set the raycast to use that camera and it's been trouble-free ever since. Hope this helps someone else.

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 sharmoni · Aug 03, 2010 at 12:36 AM 0
Share

And no, that just caused the same problem. I'm not getting a correlation between where I touch in the screen view and the object in the world space. If anybody reads this who understands the various ray hit options I would appreciate some recommendations.

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

No one has followed this question yet.

Related Questions

How I make finger touch move texture offset 0 Answers

Mobile game Player follow finger input problem (C#) 2 Answers

GUI texture touch to input 1 Answer

object falow finger problem ? 4 Answers

Input.GetKeyDown doesn't work first button press 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