x


Input.mousePosition equivalent to first finger touch?

is unity's input.mousePosition equivalent to first finger touch in mobile and touchscreens?

more ▼

asked Oct 29 '11 at 04:56 AM

ina gravatar image

ina
3.3k 492 549 599

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

If you are talking about Touch inputs, check the following links.

http://unity3d.com/support/documentation/ScriptReference/Touch.html http://unity3d.com/support/documentation/ScriptReference/Input.html

To pull the info of 1st touch, use the fingerID to check if it's the first touch. To get the positions, use the touch position. Try using Input.GetTouch(0).position.

Good luck!

more ▼

answered Oct 30 '11 at 01:10 AM

GoSuNeem gravatar image

GoSuNeem
268 1 1 6

Input.mousePosition appears to be equivalent to the first touch point. Try it!

Oct 30 '11 at 05:49 AM ina

Oh whoops! Sorry. Thought u were asking from Mouse input -> Touch not the other way.

Anyways, Yes Input.mousePosition is same as touch.position.

button click downs are... Input.GetMouseButton(0)

http://unity3d.com/support/documentation/ScriptReference/Input.GetMouseButton.html

Input.mousePosition is the position of the mouse (Vec2)(x,y)

http://unity3d.com/support/documentation/ScriptReference/Input-mousePosition.html

Sorry about the confusion.

Oct 30 '11 at 06:04 AM GoSuNeem

it looks like Input.mousePosition actually returns a Vector3 with z coordinate 0, while Input.touch.position returns just a Vec2...

Oct 30 '11 at 10:48 PM ina
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x954
x580
x413
x75
x64

asked: Oct 29 '11 at 04:56 AM

Seen: 3913 times

Last Updated: Oct 30 '11 at 10:48 PM