x


iOS navigation + touch

Hi,

Im a newbie in iOS Unity game development, so i want to ask Your help in some situations.

Situation 1:

As there is possibility to touch with one finger, then also there is a possibility to touch with multiple fingers...

In my situation i need that if there is more than one finger on surface then it takes the first one (id= 0 or something?) that has been touched first and use it similarly as mouse Cursor.

Of course, Ive heard that there needs to be exception if there is the whole hand or maybe face on the surface- then game doesnt react to this touch, well i guess it could be up to 5 touch places at once.

Situation 2:

Ive got Navigation Joystick as GuiTexture and there is also another GuiTexture that is background to it.

I think that what needs to be done is that this Joystick cant be moved outside this border, but also Joystick reset on its default (start) position if its released and dependent of this Joystick movement FPController rotates around the World.

PS. I already know that there is Joystick skript in Standart Mobile Assets, BUT I dont need it less complicated.

Thanks for help! Sorry for writing mistakes!

more ▼

asked Apr 13 '11 at 09:21 PM

Sacristan gravatar image

Sacristan
63 7 8 13

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

1 answer: sort voted first

pragma strict

var rotateJoystick : Joystick;

var cameraPivot : Transform; var cameraTransform : Transform;

var rotationSpeed : Vector2 = Vector2( 50, 25 );

function OnEndGame() { rotateJoystick.Disable();

this.enabled = false;

}

function Update() {
var camRotation = rotateJoystick.position; camRotation.x *= rotationSpeed.x; camRotation.y *= rotationSpeed.y; camRotation *= Time.deltaTime;

cameraPivot.Rotate( 0, camRotation.x, 0);
cameraPivot.Rotate( -camRotation.y, 0, 0);

}

more ▼

answered Apr 16 '11 at 04:08 PM

Sacristan gravatar image

Sacristan
63 7 8 13

(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:

x577
x214
x100
x4

asked: Apr 13 '11 at 09:21 PM

Seen: 1350 times

Last Updated: Apr 13 '11 at 09:21 PM