# hitTest not working?

**URL:** <https://forum.kirupa.com/t/hittest-not-working/320411>\
**Category:** flash\
**Created:** [March 22, 2011, 8:24pm UTC](https://forum.kirupa.com/t/hittest-not-working/320411 "2011-03-22T20:24:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelchandler](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@michaelchandler](https://forum.kirupa.com/u/michaelchandler)\
**Post date:** [March 22, 2011, 8:24pm UTC](https://forum.kirupa.com/t/hittest-not-working/320411/1 "2011-03-22T20:24:04Z")

</div>

I’m having a little trouble with my hitTest or something. I’m really not sure what I’m doing wrong, and I was wondering if you could help me out.

So I have an object called “fruit” and when my “player 2” collides with “fruit” I want the number variable “score2” to increase by 1, then output to my text box, “ch1”.

Here’s what I have.

> var score2:Number = 0;  
> ch1.text = score2;  
> if((\_root.fruit).hitTest(this.player2))  
> score2 = score2+1;  
> ch1.text = score2;

But when they collide, nothing happens.

What am I doing wrong?
