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 Flamesilver · Feb 13, 2015 at 06:02 PM · androidtouchtouchscreen

Android Screen.width/height giving weird results (212,377)?

I'm starting out Android development, with my HTC M8 connected to Unity via Unity Remote 4. I'm getting some weird results for Screen.width / Screen.height. It's giving me (212x317) when I try to force Game resolution (in Game view) to 1080x1920 (resolution of my M8). When I use free aspect the game window reads 1080x1776, but screen size is reading (229 x 377). That is really weird to me, even though it's giving me decimal point precision...

Also, I notice that the world resolution doesn't go past 1 decimal. So I would sometimes move my touch position by .1, but the world position when I do Screen to world point doesn't change. Is there anything I can do to compensate that?

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 meat5000 ♦ · Feb 13, 2015 at 06:14 PM 2
Share

I think Unity Remote is not a true estimation as its a Pseudo-run rather than a deployment.

Run your app on device and throw the screen size out to the GUI to see what it says there.

avatar image hexagonius · Feb 13, 2015 at 10:26 PM 1
Share

All I know about that is, that you get a scaled version of the game window on your Unity 4 Remote App Screen. While adjusting it you should see it changing quality of rendered objects. $$anonymous$$y guess is, Screen.width and height in this case return the maximum resoluted version of the streamed image (I think, what the USB cable can do).

I never had problems with a ScreenToWorldPoint of either touch or mouse. Decimal precision could be clamped because that's the default for Debug.Log (if that's what you're using);

avatar image Flamesilver · Feb 14, 2015 at 02:19 AM 0
Share

Ah!! Clamped in Debug.Log! Thanks for letting me know :)

0 Replies

· Add your reply
  • Sort: 

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

21 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

Related Questions

I can't change the sprite using the Touch class 0 Answers

Touch Input madness 2 Answers

Three finger tap? 1 Answer

Processes two touches instead of one 0 Answers

How can I tell if the device I am on supports touch? 4 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