collision questions

Hello,

I have a question about preCollision event ; I study the contact event and I see that preCollision event occurs after collision, not before

 local r1=display.newRect(x, y, 100, 20) physics.addBody( r1 ) local n = 0 local function onCollide( event ) print(n..")"..event.name.." + "..(event.phase or "")) n=n+1 end r1:addEventListener("preCollision",onCollide) r1:addEventListener("collision",onCollide) r1:addEventListener("postCollision",onCollide)

That’s print

0)collision + began 1)preCollision + 2)postCollision + 3)collision + ended

and so on … The first record collision is the normal collision, not the preCollision.

In addition on that, the event.contact userData is not the same ( like i was thinking ) for two succed collisions event.

Thanks for your explanation.

Yvan.

Ok, I think I understand. Is it like a " just before making collision’s calculations "  ??? And the " event.contact.isEnabled=true" is a way to transform the body in a sensor body, just for that contact ???

Thanks

Ok, I think I understand. Is it like a " just before making collision’s calculations "  ??? And the " event.contact.isEnabled=true" is a way to transform the body in a sensor body, just for that contact ???

Thanks