x


move a GameObject based on Input.GetTouch

My game has a Orthographic camera, and i want to move a gameobject based on the touch input on a iOS device. What is the best way to translate the touch position to the gameobjects X & Y position. So the gameobject stays exactly on the toch position?

more ▼

asked Sep 07 '10 at 05:34 PM

Mattivc gravatar image

Mattivc
1.7k 55 60 67

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

1 answer: sort voted first

I managed to solve the problem by feeding the touch position into Camera.ScreenPointToRay. And then applying the result to the gameobject.

more ▼

answered Sep 11 '10 at 10:35 AM

Mattivc gravatar image

Mattivc
1.7k 55 60 67

Thank you for stating how you solved your problem. Too few times do I see questions get resolved and no follow-up done to let others know how it was solved. :)

Sep 13 '10 at 12:20 PM GravitySpec
(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:

x2091
x1281
x955
x581
x30

asked: Sep 07 '10 at 05:34 PM

Seen: 3169 times

Last Updated: Sep 07 '10 at 05:34 PM