making a jump iOS

Hi,how can you make a jump with iOS. Im just testing it and the unity remote 4 app is good… but I’m having a problem,I’m creating a very simple jump. For some reason this script doesn’t work. Please tell me what is wrong or what i forgot.

using UnityEngine;
using System.Collections;

public class taptojump : MonoBehaviour {

    public GameObject cube;
    private float jumped;

    // Use this for initialization
    void Start () {
   
    }
   
    // Update is called once per frame
    void Update () {
   
#if UNITY_EDITOR

        if (Input.GetMouseButtonDown(0)) {

            gameObject.transform.position = new Vector3(209,5,43);
            jumped = Time.realtimeSinceStartup;
       
        }

        if (Time.realtimeSinceStartup - jumped == 1) {

            gameObject.transform.position = new Vector3(209,1,43);

        }

#endif

    }



}

thanks for your help

Your iOS has a mouse button?

You may want to look at this:

no,but I have built the app for iOS with means that if i write # if UNITY_EDITOR it should think its a tap,or at least that happens

But then it only works in unity editor.

And you’re trying to “jump” with the gameObject, that has the code, or with the cube?

oh,with the game object,forget the cube

and i will change that later so it works outside also

You should really look into “GetTouch”. I think, #if UNITY_EDITOR works only in the editor, and it disabled during an IOS build.

ok thx

and then how can you just get a simple touch

if (Input.GetTouch) {

}
Remember this link:

You should look at it

ok i have