this is a heavily summarized version of a question i posted in answears but has still not been approved by moderators after 9 hours.
Here are the questions in bullets:
To position things in phone i must use 0-1 coordinate system with (0,0) originating bottom-left?
Unity screen space uses pixel coordinate system with (0,0) originating top-left?
To potentially position something correctly on my phone i would have to, first, convert the values so both coordinate system’s (0,0) are bottom-left, second, i would have to convert the number of pixels in the pixel coordinate system to 0-1 to match the phone positioning system of phone?
When script is running in mobile environment and i return the position value of a empty gameobject, does this value already come in 0-1 coordinate system or is it in pixels or in world space?
any answers to any of my questions above would be hugely appreciated
@rchmiel thank you sir, you were the absolutely only one who gave enough of a care to even give a small answer to a simple question, surly i can’t rely on the answers section because my question is still pending moderator approval after 2 days now.
Well anyways, i was surprised that Input.GetTouch(0).position gives a pixel value, i have read on multiple posts that to position something on mobile device you have to use 0-1 coordinate system, however after reading the documentation on Input.GetTouch(0).position i see that it actually returns pixels. (so i wonder what that 0-1 coordinate system was for).
I would figure out these things myself but no matter what i try unity will not recognize my phone when it is plugged in (even though dev mode on, usb debugging on, etc.) thus to test something i have to manually drag it into the files and install manually from within the phone, which take considerable amount of time overall.
*so this is what i understood to get the results that i want (confirmation would be appreciated):
i use Camera.WorldToScreenPoint to get position values in pixels
i invert the .y component of Input.GetTouch(0).position
i now have matching coordinate system?
the reason i’m asking is because i’m trying to make a button with position conditional statements but haven’t been able to get it to work.
(to set a position of a gameobject in mobile, do you use pixel coordinate system or some other system?)
as you can see i didn’t have to invert my .y component and it worked great for making a button on a mobile setting without using gui (LB,RB,TB,BB stands for left-bracket,right-bracket,top-bracket,bottom-bracket which are aligned respectively ex: left-bracket is a empty gameobject aligned with the furthest left side of the button image, etc.)
Maybe it’s works, but you unnecessarily complicates code. How you show button? You use GUI.Button or GameObject on scene? What he have to do - load next scene or turn on run?
To testing your app you need to set SDK settings - look on forum, there are many topics about this.