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?