# Problem with a falling character

**URL:** https://forum.kirupa.com/t/problem-with-a-falling-character/332242
**Category:** flash
**Created:** [March 18, 2014, 11:48pm UTC](https://forum.kirupa.com/t/problem-with-a-falling-character/332242 "2014-03-18T23:48:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bmmeyers33](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@bmmeyers33](https://forum.kirupa.com/u/bmmeyers33)
#### Post date: [March 18, 2014, 11:48pm UTC](https://forum.kirupa.com/t/problem-with-a-falling-character/332242/1 "2014-03-18T23:48:00Z")

</div>

Hi, I am making a game and for some reason, when my character lands, instead of stopping immediately when he hits the ground, he goes up and down 2 or 3 times (helps to slow the fps down low to see it). I can’t for the life of me figure out why this keeps happening, instead of just stopping when he hits the platform.

Heres my falling code:

onClipEvent(enterFrame) {

```
platform = _level0.stage.platform; // the platform he lands on

// Y Movement //
this._y += GokuFallSpeed;
if (!platform.hitTest(this._x,this._y + GokuFallSpeed,true)){ // If Goku is not on a platform
    if (GokuFallSpeed &lt; fallSpeedLimit) {
        GokuFalling = true;
        GokuFallSpeed += _level0.gravity;
    }
}
if (platform.hitTest(this._x,this._y + GokuFallSpeed,true)){ // If Goku is on a platform
    if (GokuFallSpeed &gt;= 0) {
        GokuFalling = false;
        GokuFallSpeed = 0;
    }
}

```

}

So I am using hitTest to determine where he should stop falling.  
I attached the game file.
