i tried to simulate your issue
see the below code
[lua]local gameGroup = display.newGroup()
local physics = require(“physics”)
physics.start()
function newObject()
local rand = math.random( 110 )
obj = display.newText(rand,0,0,nil,20)
obj.x = 10 + math.random( 200 )
obj.y = -100
obj.hit = 0
physics.addBody( obj, { density=0.5, friction=0.3, bounce=0} )
end
local dropobjects = timer.performWithDelay( 1000, newObject, 100 )
local groundLine = display.newLine(10, 300, 320, 300)
groundLine.width = 5
groundLine:setColor( 255, 0, 0)
local function removeObject(event)
if event.other.hit == nil then
event.other.hit = 1
–uncomment the below line to remove object on collision
–timer.performWithDelay(100, function() event.other:removeSelf() end)
end
end
physics.addBody( groundLine, “static”)
–use the below code to remove object once it pass the line
–physics.addBody( groundLine, “static”,{ isSensor = true})
groundLine:addEventListener(“collision”,removeObject)[/lua]
can you see something strange when u execute it ?
the objects are actually bouncing on the left side of the line but not on the right side ? do you have any idea why that happens ? [import]uid: 71210 topic_id: 13320 reply_id: 48951[/import]