I’m having a problem where blocks won’t fall down holes, even though the size should be just right.
I’ve made a simple example to show you:
[lua]local smallblock1 = display.newImageRect( “block_stone.png”, 32, 32 )
smallblock1:setReferencePoint( display.TopLeftReferencePoint )
smallblock1.x = 0
smallblock1.y = 448
physics.addBody( smallblock1, “static”, { density=1, friction=0.3, bounce=0.2 } )
–BIG BLOCK
local bigBlock = display.newImageRect( “block_4square.png”, 64, 64 )
bigBlock:setReferencePoint( display.TopLeftReferencePoint )
bigBlock.x = 32
bigBlock.y = 384
physics.addBody( bigBlock, { density=1, friction=0.3, bounce=0.2 } )
bigBlock.isFixedRotation = true
local smallblock2 = display.newImageRect( “block_stone.png”, 32, 32 )
smallblock2:setReferencePoint( display.TopLeftReferencePoint )
smallblock2.x = 96
smallblock2.y = 448
physics.addBody( smallblock2, “static”, { density=1, friction=0.3, bounce=0.2 } )[/lua]
I’ve set the Reference Point to the top left to make it easier to debug, but the result is the same even if it’s in the center.
The above code should give just enough pixels (64) between the two smaller blocks to make the big block fit, but it won’t. If I remove either of the smaller blocks it’ll fall down.
If I take a screenshot in hybrid/debug mode I can measure the size of the big block to 65px and the gap under it to 63px. I’d like to believe it should really be 64px/64px.

[import]uid: 13180 topic_id: 14374 reply_id: 314374[/import]
[import]uid: 13180 topic_id: 14374 reply_id: 53191[/import]
[import]uid: 64596 topic_id: 14374 reply_id: 53459[/import]