# Collision detection

**URL:** <https://forum.kirupa.com/t/collision-detection/232596>\
**Category:** Uncategorized\
**Created:** [July 16, 2007, 9:45am UTC](https://forum.kirupa.com/t/collision-detection/232596 "2007-07-16T09:45:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dumplin](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@dumplin](https://forum.kirupa.com/u/dumplin)\
**Post date:** [July 16, 2007, 9:45am UTC](https://forum.kirupa.com/t/collision-detection/232596/1 "2007-07-16T09:45:32Z")

</div>

Hi, I’m strugling with a hit test. There are no bugs but my objects are not coliding. I’m stuck. Dunno if anyone can help, this is the coding for that:

//check for collision  
for (i=1; i\<=\_root.numasteroid; i++){  
if(this.hitTest(\_root.asteroid+i)){  
\_root.asteroid+i(gotoAndPlay(2));  
}else{  
\_root.score+=1;  
}

}

}  
}

Thanks!
