# Making a ground? Collision help!

**URL:** <https://forum.kirupa.com/t/making-a-ground-collision-help/273378>\
**Category:** Uncategorized\
**Created:** [October 14, 2008, 11:21pm UTC](https://forum.kirupa.com/t/making-a-ground-collision-help/273378 "2008-10-14T23:21:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shred49](https://avatars.discourse-cdn.com/v4/letter/s/ed655f/32.png) [@Shred49](https://forum.kirupa.com/u/Shred49)\
**Post date:** [October 14, 2008, 11:21pm UTC](https://forum.kirupa.com/t/making-a-ground-collision-help/273378/1 "2008-10-14T23:21:26Z")

</div>

im making a 2d game with platforms and walls and floors and such, i’ve got most of the physics i need. gravity, speed, ect. But when he is supposed to stop after "hitting the ground he just goes straight thru. The ground he should stop at is a mc called bg and inside is a mc called platform. what am i doing wrong?

```auto
onClipEvent(enterFrame){
    //Keeps Character from going thru the floor, roof & walls
    if(this.hitTest(_root.bg.platform)==true
        gravity = 0;
}

```
