x


iphone camera rotation by touch

Hi

I'm doing an airplane game and I want to be able to look to the sides of the cockpit. I want then that the user can press the center of the screen and slide the finger from left to right or viceversa and the camera will look into that direction.

How can I do this? I was thinking maybe using a sphere collider and detecting a raycast but since i only want to use horizontal movement i don't know if that's the best way to achieve it. Any ideas? Any easy script?

more ▼

asked Sep 25 '10 at 09:47 PM

creat327 gravatar image

creat327
18 5 5 7

I found the MouseOrbit script on the standard asseets and the wiki but it has a bug. too understand what i mean, get your target and turn it around to the left 140 degrees for instance. Now just 'click' the mouse but don't move it. If everything is correct, no camera orbit should happen since you are not moving the mouse. You will see this is not the case, the camera will rotate to some other default position.

Sep 26 '10 at 03:05 PM creat327
(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

Hey Guys have you found any think about this??? :(

more ▼

answered Feb 23 '11 at 12:14 AM

Chakroun Yesser gravatar image

Chakroun Yesser
16 4 4 6

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

Were you able to figure this out? I'm banging my head right now trying to get it working. Thanks.

more ▼

answered Dec 18 '10 at 09:40 PM

Brettman gravatar image

Brettman
1

no luck. I tried every possible combination without success. If you manage to figure it out please let me know because it's very important for my game :/

Dec 19 '10 at 10:43 AM creat327
(comments are locked)
10|3000 characters needed characters left

Hmm, the first thing I would try is to use touch deltaPosition to modify the camera's localEulerAngles.z property.

more ▼

answered Sep 25 '10 at 11:27 PM

goodhustle gravatar image

goodhustle
3

nope, that doesn't do it. I found the Orbit script on the wiki and standard assets but it has a bug: too understand what i mean, get your target and turn it around to the left 140 degrees for instance. Now just 'click' the mouse but don't move it. If everything is correct, no camera orbit should happen since you are not moving the mouse. You will see this is not the case, the camera will rotate to some other default position.

Sep 26 '10 at 03:05 PM creat327
(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:

x3005
x2000
x580

asked: Sep 25 '10 at 09:47 PM

Seen: 1980 times

Last Updated: Sep 25 '10 at 09:47 PM