# Hittest not working :p

**URL:** https://forum.kirupa.com/t/hittest-not-working-p/244813
**Category:** Uncategorized
**Created:** [November 22, 2007, 1:21am UTC](https://forum.kirupa.com/t/hittest-not-working-p/244813 "2007-11-22T01:21:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![leonthelion](https://avatars.discourse-cdn.com/v4/letter/l/58956e/32.png) [@leonthelion](https://forum.kirupa.com/u/leonthelion)
#### Post date: [November 22, 2007, 1:21am UTC](https://forum.kirupa.com/t/hittest-not-working-p/244813/1 "2007-11-22T01:21:04Z")

</div>

Im having a problem with a hittest, first I have for the player if you press down it goes to the attack frame where there is a variable called attackhit and its set to true. Now on the enemy I have this code:

```php
 
onClipEvent(enterFrame) { 
     if(this.hitTest(_root.guy)) { 
          _root.touch = true} 
     else{ 
          _root.touch = false} 
     if((_root.touch)){ 
  if(attackhit==true){_root.hp-=10}
     } 
} 

```

Problem is its not working 😛 any help with this?
