How i can get the exact point of a collision?

I’ve been looking for the answer all day but i didnt find the answer i want :’(

I’m using the event.x and event.y variables and they always return me 0 and 0… So they dont work, as i read probably thats a limitation of Box2d

I just wanna know if i’m receiving the collision on the top, lef, right, or bottom of a ship…

Thanks and sorry for my bad english… :S

This sounds like it might be useful to you:
 

http://docs.coronalabs.com/api/library/physics/setReportCollisionsInContentCoordinates.html

As always thanks for your answers Rob.

I tried this before and still having the same problem. The coordinates i recive are 0, 0 all the time.

The 2 objects that i’m trying to collide are objects made by physics editor and the code I use to collide is something like this:

 function onLocalCollision( self, event ) if(event.other == paredes) then print(event.x.." "..event.y) velJostick = 0 velocidad = 0 local variablemov = paredes.y -10 transition.to(paredes, {y = variablemov, time=0}) velJostick = 1 velocidad = 1.5 end end 

All i wanna do is move the “paredes” object on the opposite direction where self object collide with “paredes”

Thanks for your time :slight_smile:

It’s done :slight_smile: This dont work if they are sensor! Thanks :slight_smile:

This sounds like it might be useful to you:
 

http://docs.coronalabs.com/api/library/physics/setReportCollisionsInContentCoordinates.html

As always thanks for your answers Rob.

I tried this before and still having the same problem. The coordinates i recive are 0, 0 all the time.

The 2 objects that i’m trying to collide are objects made by physics editor and the code I use to collide is something like this:

 function onLocalCollision( self, event ) if(event.other == paredes) then print(event.x.." "..event.y) velJostick = 0 velocidad = 0 local variablemov = paredes.y -10 transition.to(paredes, {y = variablemov, time=0}) velJostick = 1 velocidad = 1.5 end end 

All i wanna do is move the “paredes” object on the opposite direction where self object collide with “paredes”

Thanks for your time :slight_smile:

It’s done :slight_smile: This dont work if they are sensor! Thanks :slight_smile: