Problems with rigidbody2D.AddForce

Hi! , Im trying to get jumps like the game “the impossible game”:


Well, I wrote the essential, some rigidbody2D.AddForce to make the jump etc, the PROBLEM is that when I click ( It add the force in Y) it add more force to X, and obviously I don’t want that, I want to keep the velocity in the X.

And sorry for my english ^^ Ohh and if someone knows how to do these types of jumps like the video I posted, tell me please! I tried to change the gravity but I still without get this type of jumps hehe.

Here is the code, hope you can help me guys!:

using UnityEngine;
using System.Collections;

public class controladorPersonaje : MonoBehaviour {

	public float fuerzaSalto = 100f;
	public float fuerzaCorrer = 100f;

	public bool enSuelo = true;
	public bool enSuelo1 = true;
	public bool enSuelo2 = true;
	public bool enSuelo3 = true;
	public bool enSuelo4 = true;


	

	public Transform comprobadorSuelo;
	float comprobadorRadio = 0.07f;
	public Transform comprobadorSuelo1;
	float comprobadorRadio1 = 0.07f;
	public Transform comprobadorSuelo2;
	float comprobadorRadio2 = 0.07f;
	public Transform comprobadorSuelo3;
	float comprobadorRadio3= 0.07f;
	public Transform comprobadorSuelo4;
	float comprobadorRadio4 = 0.07f;
	public LayerMask mascaraSuelo;
	private Animator animator;

	void Awake(){
		animator = GetComponent<Animator> ();
		}

	// Use this for initialization
	void Start () {

	}

	void FixedUpdate(){


				enSuelo = Physics2D.OverlapCircle (comprobadorSuelo.position, comprobadorRadio, mascaraSuelo);
				animator.SetBool ("isGrounded", enSuelo);

		enSuelo1 = Physics2D.OverlapCircle (comprobadorSuelo1.position, comprobadorRadio1, mascaraSuelo);
		animator.SetBool ("isGrounded", enSuelo1);
		
		
		enSuelo2 = Physics2D.OverlapCircle (comprobadorSuelo2.position, comprobadorRadio2, mascaraSuelo);
		animator.SetBool ("isGrounded", enSuelo2);
		
		enSuelo3 = Physics2D.OverlapCircle (comprobadorSuelo3.position, comprobadorRadio3, mascaraSuelo);
		animator.SetBool ("isGrounded", enSuelo3);
		
		enSuelo4 = Physics2D.OverlapCircle (comprobadorSuelo4.position, comprobadorRadio4, mascaraSuelo);
		animator.SetBool ("isGrounded", enSuelo4);

		rigidbody2D.AddForce (new Vector2 (fuerzaCorrer, 0));

		if (enSuelo && Input.GetMouseButton (0) || enSuelo1 && Input.GetMouseButton (0)|| enSuelo2 && Input.GetMouseButton (0)|| enSuelo3 && Input.GetMouseButton (0)|| enSuelo4  && Input.GetMouseButton (0)) {


			rigidbody2D.AddForce (new Vector2 (0, fuerzaSalto));
			//transform.Rotate(new Vector3(0,0,70));
			//transform.Rotate(0, Time.deltaTime * 30, 0, Space.Self);


				}

		}
	// Update is called once per frame



	void Update () 
	{

	}
		

}

Oh, I get it. You’re probably experiencing drag due to friction when your object is grounded. There are various ways to address this problem, and selecting the appropriate method depends on your preference for how the object should behave.

Since you want to move with the same X velocity at all times, the easiest way is probably giving the object a physics material with zero friction. Also, to maintain this same-X-velocity rule, you might consider setting the rigidbody’s “drag” property to zero as well.