Is it possible to get the actual x, y of a collision of two objects? I know how to get the coordinates of the two respective shapes involved, but how to get the collision point in-between the two?
Did you get my response to this? I don’t think you can get the actual point of impact, but by getting the midpoint of both coordinates, that may be your best guess. I am using this technique in my current game and it’s working out pretty good. local midX = ( event.object1.x + event.object2.x ) \* 0.5
local midY = ( event.object1.y + event.object2.y ) \* 0.5
Did you get my response to this? I don’t think you can get the actual point of impact, but by getting the midpoint of both coordinates, that may be your best guess. I am using this technique in my current game and it’s working out pretty good. local midX = ( event.object1.x + event.object2.x ) \* 0.5
local midY = ( event.object1.y + event.object2.y ) \* 0.5
In native iOS cocos2d/box2d frameworks you can get collision points and force in each point. Do you (coronalab) plan to implement this functionality? Now it’s really hard issue if you have something more complicated than a circle or a square.
This feature had some issues previously, but it was recently fixed by the engineers and should be available to users soon. I’m not 100% sure that it includes the “force” of each specific point in a multi-point collision, but you should be able to read all points involved in a collision and handle them accordingly.
The “corrected” collision point is retrieved in the traditional method… “event.x” and “event.y” (see link below). Now, the point should be correct (it wasn’t reliable before), and you can also “average” the points if two objects collide at multiple points in one collision cycle. We might expand this even further in the future to let you handle each and every point in a multi-point collision individually, but for now, you can get the first collision point or the average point.
In native iOS cocos2d/box2d frameworks you can get collision points and force in each point. Do you (coronalab) plan to implement this functionality? Now it’s really hard issue if you have something more complicated than a circle or a square.
This feature had some issues previously, but it was recently fixed by the engineers and should be available to users soon. I’m not 100% sure that it includes the “force” of each specific point in a multi-point collision, but you should be able to read all points involved in a collision and handle them accordingly.
The “corrected” collision point is retrieved in the traditional method… “event.x” and “event.y” (see link below). Now, the point should be correct (it wasn’t reliable before), and you can also “average” the points if two objects collide at multiple points in one collision cycle. We might expand this even further in the future to let you handle each and every point in a multi-point collision individually, but for now, you can get the first collision point or the average point.
I don’t know what influenced means. For me, it seems to mean I get event.x and event.y coordinates that do not match what I would expect to be the global x/y coordinates when I set it to true and I get 0 when it is not there.
Maybe the fact that I am using scenes or DisplayGroups is affecting this in some way?
At first glance, it appears you’re not utilizing the proper parameters in the collision listener. Since this is a “local” collision listener (not a Runtime one), the listener supports both “self” and “event”… you’re using just “event”, but that should be the second additional parameter.
Please see the guide on “Local collision listeners” here: