Here’s the issue I am having:
Imagine you want an image that rotates in the same way that a clock’s second hand does… you would do something like this:
line = display.newImageRect("line.png", 6, 85)
ine:setReferencePoint(display.BottomCenterReferencePoint)
line.x = CenterX --center of the screen
line.y = CenterY --center of the screen
line.rotation = 0
local function enterFrame( event )
line.rotation = line.rotation + 1
line:setReferencePoint(display.BottomCenterReferencePoint)
end
Now let’s say you want this to be a physical platform that objects can collide against. You would add:
physics.addBody(line, "dynamic", lineBody)
to the above code.
I’ve tried adding this line of code before and after EVERY line of code I mentioned above and it does not collide properly. I set the physics engine to hybrid mode and it is telling me that the collision is set properly around the line when it is not.
The platform is colliding with objects as if it is rotating in the center, as if I had written the above code without this in either of the two spots:
line:setReferencePoint(display.BottomCenterReferencePoint)
Any ideas on what to do?
[import]uid: 36054 topic_id: 7516 reply_id: 307516[/import]