Stupid hitTest!

Do I get an award for most demanding member? :stuck_out_tongue:

Alright, more problems with my Gun Game. I’m trying to create a Laser, so that when a user aims, say, behind the box, the box gets the bullet hole. Here’s the script for the laser.

_root.createEmptyMovieClip(ā€œlaserā€, 1);
laser.onEnterFrame = function() {
laser.clear();
laser.lineStyle(2, 0xFF0000, 100);
laser.moveTo(guy.gunlocation.x, guy.gunlocation.y); //Gun’s Location
laser.lineTo(crossair._x, crossair._y); //Crossair’s Location
};

As you can see above, the laser starts at the gun’s position and follows the crossair. This is the hitTest command line:

if (laser.hitTest(square)) {
hittest.text = ā€œHIT!ā€
} else {
hittest.text = ā€œNo Hitā€
}

But for some reason, this doesn’t work. Every time I shoot, no matter where the laser is, hitTest = true. I have no idea why it doesn’t work. Attached is the latest version of Gungame, with the laser. And by the way, because of the laser (for some reason) the bullet holes don’t appear. Could you guys help me out.