# ACK! i am stuck =\[

**URL:** <https://forum.kirupa.com/t/ack-i-am-stuck/264018>\
**Category:** flash\
**Created:** [June 22, 2008, 6:33am UTC](https://forum.kirupa.com/t/ack-i-am-stuck/264018 "2008-06-22T06:33:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lolz](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@lolz](https://forum.kirupa.com/u/lolz)\
**Post date:** [June 22, 2008, 6:33am UTC](https://forum.kirupa.com/t/ack-i-am-stuck/264018/1 "2008-06-22T06:33:58Z")

</div>

ok so heres the problem  
I need a life counter similar to mario or sonic side-scrolling games where if the MC of the enemy hits the MC of my character it will subtract 1 life, yet no matter how hard i try to come up with it it never works for me. I have visited countless tutorial site but still have not figured it out:m:

any suggestions/help would be greatly appreciated:angel:

---

<div class="post-metadata">

**Author:** ![jeremywilms](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@jeremywilms](https://forum.kirupa.com/u/jeremywilms)\
**Post date:** [June 23, 2008, 6:30am UTC](https://forum.kirupa.com/t/ack-i-am-stuck/264018/2 "2008-06-23T06:30:48Z")

</div>

add trace(“Hit”); within the hitTest code block, if you don’t get “Hit” in the console then your comparing undefined objects. Try add the \_root prefix or use the target sign above your action script panel to locate the two parts you wish to hitTest. So you would go

if(this.hitTest(\_root.MovieClipToCollideWith))  
{  
\_root.hp–;  
}
