# Help with registration Point calculation

**URL:** <https://forum.kirupa.com/t/help-with-registration-point-calculation/313119>\
**Category:** flash\
**Created:** [August 20, 2010, 1:56pm UTC](https://forum.kirupa.com/t/help-with-registration-point-calculation/313119 "2010-08-20T13:56:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![touches](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@touches](https://forum.kirupa.com/u/touches)\
**Post date:** [August 20, 2010, 1:56pm UTC](https://forum.kirupa.com/t/help-with-registration-point-calculation/313119/1 "2010-08-20T13:56:15Z")

</div>

Hello i have this problem… My movieclip width and height are 69 and 59… and my registration point is at the center. So for colliding the bottom edge of the movie clip with the ground i have added the height along with the y variable. This just stops the movieclip at its edge when it touches the ground. Now my problem comes whenever i try to perform a jump action it does not work… whereas if i remove the height offset from the y variable the jumping works but the movieclip collides with the ground at its center that is it goes partially into the ground  
this is my code

```auto

onClipEvent (load) {
    var ground:MovieClip = _root.ground;
    var grav:Number = 0;
    var gravity:Number = 2;
    var speed:Number = 5;
    var maxJump:Number = -18;
    var touchingGround:Boolean = false;

}
onClipEvent (enterFrame) {

    _y += grav;
    grav += gravity;

    while (ground.hitTest(_x, _y+25, true)) // here if its _y it works {                                                               

        _y -= gravity;
        grav = 0;
    }
    if(ground.hitTest(_x,_y+25,true))
        touchingGround=true;
    else
        touchingGround=false;
        trace(touchingGround);
    
    if(Key.isDown(Key.UP)&&touchingGround){
        grav=maxJump;
    }
}

```

I have also added the fla file… Please help me out
