- Home /
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!
Answer by Sacristan · Apr 16, 2011 at 04:08 PM
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);
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613122620im_/https://answers.unity.com/themes/thub/images/avi.jpg)