This is probably the only issue I’m having before releasing the SVG Level Builder.
If I have a physics body rotated and its reference point is not the center, collisions won’t work as expected. They will either process as the body was in front or behind of the actual body.
Another one: the ground rectangle is TopLeft Reference Point too, but since it is not rotated the circles are correctly colliding.
On the following test code, the circles collide before hitting the first rectangle and then collide in the middle of the second rectangle.
[lua]local physics = require(“physics”)
physics.start()
physics.setDrawMode(“debug”)
for i=1,10 do
local circle = display.newCircle(100, 100, 10)
circle.x = 250
circle.y = 180
physics.addBody(circle, “dynamic”, {radius = 10})
end
local rect = display.newRect(0, 0, 100, 20)
rect:setReferencePoint(display.TopLeftReferencePoint)
rect.x = 200; rect.y = 200
rect.rotation = 10
physics.addBody(rect, “static”)
local rect = display.newRect(0, 0, 100, 20)
rect:setReferencePoint(display.TopLeftReferencePoint)
rect.x = 300; rect.y = 200
rect.rotation = -10
physics.addBody(rect, “static”)[/lua]
[import]uid: 10990 topic_id: 8019 reply_id: 308019[/import]