|
I saw the document say vector2's x axis is between 0 and 1.I have a question!Input.GetTouch(i).position is a vector2?right?But I saw Input.GetTouch(i).position.x is between 0 and 480(My mobile screen's size)!Why?And how can I normalize it to vector2's standard 0-1?
(comments are locked)
|
|
Vector2 x and y components are arbitrary floating-point numbers. A particular function will return values as documented for that specific function. To normalise a Touch position, divide x by Screen.width and y by Screen.height. I want to do http://this.It should come out a object where I touched the screen!But the object's position is 0 to 1.Input.GetTouch.position is 0 to my mobile's width. How to do this?
Sep 02 '11 at 01:47 AM
noob22
Sorry, but you're really hard to understand.
Sep 02 '11 at 06:43 AM
Waz
(comments are locked)
|
|
No, Vector2 is two floats, so x and y have the range of a single-precision float. I want to change x and y have the range of 0 to 1?How to do it?
Sep 02 '11 at 01:37 AM
noob22
Maybe you can make vector2 x or y to bigger than 1,but you cannt see your object in camera?
Sep 02 '11 at 01:40 AM
noob22
(comments are locked)
|
