How to make a game object jump?

In 2DPlatformer example

I want the game object to be jumping when it walks

function Update () 
{
        jump.lastButtonTime = Time.time;
	ApplyJumping ();
}

function ApplyJumping () 
{
	if (jump.lastTime > Time.time) 
		return;

	if (transform.position.y == 1) 
	{	
		if (jump.enabled  Time.time < jump.lastButtonTime + jump.timeout) 
		{
			transform.Translate(Vector3.up * Time.deltaTime); 
			movement.verticalSpeed = CalculateJumpVerticalSpeed (jump.height);
			movement.inAirVelocity = lastPlatformVelocity;
			SendMessage ("DidJump", SendMessageOptions.DontRequireReceiver);
		}
	}
}

function CalculateJumpVerticalSpeed (targetJumpHeight : float) 
{
	return Mathf.Sqrt (2 * targetJumpHeight * movement.gravity);
}

function DidJump () {
	Character.animation.Play ("jump");
}

The game object can play the “jump” animation when walk, however, it did not jump.

How to fix it?

Are you using a CharacterController here? If so, can you post the movement code for it? It is likely that the movement has a downward component (for “gravity”) and this is overriding the jumping movement.