Hi
I simply want to know the collision point of two objects. I do it like this:
ufocoll.collision = onLocalCollision2 ufocoll:addEventListener("collision", ufocoll) function onLocalCollision2(self, event) if ( event.phase == "began" ) then print (event.y) end end
The collision is detected but event.y is always zero. The gotchas don’t aply here.
Thanks for your help!
Olivier
I found the cause: If the objects are sensors event.x / event.y always are 0. It would be nice if this box 2d limitation could be solved.
Hi @solala125,
Did you set the physics engine to report the collision point in content coordinates?
https://docs.coronalabs.com/api/library/physics/setReportCollisionsInContentCoordinates.html
Best regards,
Brent
I found the cause: If the objects are sensors event.x / event.y always are 0. It would be nice if this box 2d limitation could be solved.
Hi @solala125,
Did you set the physics engine to report the collision point in content coordinates?
https://docs.coronalabs.com/api/library/physics/setReportCollisionsInContentCoordinates.html
Best regards,
Brent