- Home /
vector2 is 0 to 1?
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?
Answer by Waz · Sep 02, 2011 at 01:34 AM
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 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?
Answer by Eric5h5 · Sep 02, 2011 at 01:34 AM
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?
$$anonymous$$aybe you can make vector2 x or y to bigger than 1,but you cannt see your object in camera?
Your answer
Follow this Question
Related Questions
How to lower float value A as float value B gets bigger? 1 Answer
Input Touch.position 'inverted' relative to screen? 1 Answer
Touch.position, Touch.deltaPosition, Screen.width, Screen.Height 1 Answer
Get touch position to create floating text,Get position from touch to spawn floating text 0 Answers
Input.GetTouch(0) doesn't work 2 Answers