Making an object jump once.

I’m a newbie to Unity (of course) and I want to make a ball jump only once. I decided to use this code to make it.

	Vector3 jump = new Vector3(0.0f,250,0.0f);
	public bool InAir=false;

void OnCollisionEnter(Collision other){
		if (other.gameObject.tag=="Untagged") {
						InAir = false;
				}
		}

	void OnCollisionExit(Collision other)
	{
		InAir = true;
		}
	void Update () {
		if(Input.GetKeyDown("g")&&InAir==false)
		{
			rigidbody.AddForce(jump);
		}
		}

The code works fine, but when my ball rolls from one platform to another (two consecutive platforms at one level), the collision doesn’t work, so the ball can’t jump.
Also, when the ball stands on two or more platforms at once the force is smaller.

Sorry for my bad English. Maybe it isn’t as bad as I think.

Create one tag(platformTag)for all of your platform and in your Ball OnCollisionEnter :

 void OnCollisionEnter(Collision other){
    if (other.gameObject.tag=="platformTag") {
       InAir = false;
    else
       InAir = true;
 }

Okay, I found the answer to my question.

void OnCollisionEnter(Collision other){
		if (other.gameObject.tag == "Untagged"&&InAir==true){
						InAir = false;
				}
		}

	void OnCollisionStay(Collision other){
				if (other.gameObject.tag == "Untagged" && InAir == true) {
						InAir = false;
				}
		}

	void OnCollisionExit(Collision other)
	{
		InAir = true;
		}
	void Update () {
		if(Input.GetKeyDown("g")&&InAir==false)
		{
			rigidbody.AddForce(jump);
		}
		}

This code makes the ball not make “InAir” “true” when rolling on singleleveled platforms, and adding rigidbody with “Is Kinematic:ON” solves the problem with double platforms.