physics for a laser beam... tougher then I thought

 what  i am trying to do is simply create a laser beam object and add a physics body to it and then

put that in to isSensor and then hit the Hp of every enemy that collides with the laserbeam

However this doesn’t  seem to work very well,  

all I did was add a body from shape and rotate it to the direction the laser is shot

HOwver the collision event only gets dispatched randomly ,

I set the physics set draw mode to hybrid and found out the location, rotaion of the body is just fine and it looks like it normally collided with the enemy objects from the eye but the event just doesn’t get dispatched…

anyone can explain this problem?

I tried setiing both object to dynamic or setting one to dynamic and one to static ,that didn’t seem to be the problem though

You may have to set the laser beam as the bullet demo has with this:
http://docs.coronalabs.com/daily/api/type/Body/isBullet.html
Your laser beam may simply be too thin to register a collision because objects pass through it too quickly.
Can you simplify your code and post it? That’s always the best starting point with questions like this.

You may have to set the laser beam as the bullet demo has with this:
http://docs.coronalabs.com/daily/api/type/Body/isBullet.html
Your laser beam may simply be too thin to register a collision because objects pass through it too quickly.
Can you simplify your code and post it? That’s always the best starting point with questions like this.