I am currently trying to make a little Platform game for iOS. (This is my first Game.)
I have developed the following code to move the main Character.
void InputCheck ()
{
Touch t;
bool tOk = false;
if (Input.touchCount > 0) {
t = Input.GetTouch (0);
tOk = t.phase == TouchPhase.Began || t.phase == TouchPhase.Stationary;
}
if (Input.GetKey (KeyCode.Space) || tOk)
inputJump = true;
else
inputJump = false;
if (longDead inputJump) {
resetLevel ();
}
}
void Move ()
{
if (characterControler.isGrounded) {
moveDirection.y = -1;
if (inputJump !dead) {
moveDirection.y = jumpPower;
}
} else {
moveDirection.y -= gravity;
}
if (!dead)
moveDirection.x = speed;
else
moveDirection.x = 0;
characterControler.Move (moveDirection * Time.deltaTime);
}
The Code works just fine in Unity, so i builded it for my iPhone and tested it.
On the iPhone, the Character jumped much higher and run much faster.
Does anybody know, why there is such a big difference between the Player in Unity and the original device?
Stuff i used:
Macbook Pro - newest OS X
Unity - 4.3.4f1
Xcode - 5.0.1
iPhone 5s - newest iOS