x


Moving An Object With Touch

for(touch in iPhoneInput.touches) {
     if(touch.phase == iPhoneTouchPhase.Moved || touch.phase == iPhoneTouchPhase.Began) {
          transform.position = Camera.main.ScreenToWorldPoint(new Vector3 (touch.position.x, touch.position.y, 10));
     }
}

I have found the above code from tutorial Moving An Object With Touch but its not working when I play game in Unity3D. Can some one please help me.

more ▼

asked Dec 29 '10 at 09:47 AM

Arman gravatar image

Arman
13 3 3 10

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

0 answers: sort voted first
Be the first one to answer this question
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:

x841
x580
x96
x30

asked: Dec 29 '10 at 09:47 AM

Seen: 1991 times

Last Updated: Dec 29 '10 at 09:47 AM