# hitTest w/ Duplicate Movie Clips

**URL:** <https://forum.kirupa.com/t/hittest-w-duplicate-movie-clips/234862>\
**Category:** flash\
**Created:** [August 6, 2007, 8:35pm UTC](https://forum.kirupa.com/t/hittest-w-duplicate-movie-clips/234862 "2007-08-06T20:35:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![benbald](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@benbald](https://forum.kirupa.com/u/benbald)\
**Post date:** [August 6, 2007, 8:35pm UTC](https://forum.kirupa.com/t/hittest-w-duplicate-movie-clips/234862/1 "2007-08-06T20:35:57Z")

</div>

Okay I know this is a common problem but I just can’t seem to figure it out. The problem is that I have duplicate movie clips (bad guys) moving around a screen and I want to run hitTests on them with other objects (good guys) but haven’t been able to make it work. Here is my code

—This Part is in a frame on the root timeline—

numbadguys = 3;  
for (i=1; i\<=numbadguys; i++) {  
duplicateMovieClip(\_root.badguy, “badguy”+i, i+100);  
}

—This part is in the clip that is being duplicated—

//hittest  
\_root.die = this.hitTest(\_root.goodguy);  
if (die == true && this.\_name != “badguy”) {  
deaths = deaths+1;  
}  
}

The badguys duplicate just fine but when they hit my goodguy, the hit isn’t detected. Please help.
