# Combo-jump problem

**URL:** <https://forum.kirupa.com/t/combo-jump-problem/76968>\
**Category:** Uncategorized\
**Created:** [January 23, 2005, 8:05am UTC](https://forum.kirupa.com/t/combo-jump-problem/76968 "2005-01-23T08:05:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skribble](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Skribble](https://forum.kirupa.com/u/Skribble)\
**Post date:** [January 23, 2005, 8:05am UTC](https://forum.kirupa.com/t/combo-jump-problem/76968/1 "2005-01-23T08:05:40Z")

</div>

Hey guys, ive got a little problem, again…

Ive set it up so my hero can duck jump right. And it works 50%.

If you are ducking and walking right and you jump, you can duckjump right. But if you do it to the left. You dont jump at all.

This is whats on the duckwalk MC, on this mc you can duck and walk.

```auto

onClipEvent (load) {
	h = _root.hero;
	xSpeed = 2.8;
}
onClipEvent (enterFrame) {
	if (Key.isDown(Key.UP)) {
		**_root.hero.gotoAndStop("duckJump");**
	} else if (Key.isDown(Key.DOWN) && Key.isDown(Key.RIGHT)) {
		this.play();
		h._x += xSpeed;
		h._xscale = 100;
		_root.cAction = "duckRolling";
	} else if (Key.isDown(Key.DOWN) && Key.isDown(Key.LEFT)) {
		this.play();
		h._x -= xSpeed;
		h._xscale = -100;
		_root.cAction = "duckRolling";
	} else if (Key.isDown(Key.DOWN)) {
		this.stop();
	} else {
		h.gotoAndStop("stand");
	}
}

```

the part I bolded, is what links to the duckjump mc which contains this code…

```auto

onClipEvent (load) {
	h = _root.hero;
	xSpeed = 3;
	vel_y = 0;
	jumping = false;
	ground = _root.backGround.platform;
}
onClipEvent (enterFrame) {
	if (Key.isDown(Key.RIGHT)) {
		h._x += xSpeed;
		h._xscale = 100;
		_root.cAction = "duckJump-left";
	} else if (Key.isDown(Key.LEFT)) {
		h._x -= xSpeed;
		h._xscale = 100;
		_root.cAction = "duckJump-right";
	} if (!jumping) {
		vel_y = 15;
		jumping = true;
	}
	if (jumping == true) {
		_root.cAction = "duck-jumping";
		vel_y -= 1;
		if (vel_y<=-20) {
			vel_y = -20;
		}
		h._y -= vel_y;
	}
	if (ground.hitTest(h._x, h._y, true)) {
		vel_y = 0;
		jumping = false;
		h.gotoAndStop("duckRoll");
	}
}

```

Any ideas??
