I’m just getting started out with Corona so bare with me. I have a ball and well game I am using to learn the system. Have created the ball and the well (a sensor) and get the collision event, but I want to check to see if the ball fits in the well.
I have set
well.radius = sensorRadius
ball.radius = ballRadius
physics.addBody(ball,{density=1-dens, friction=0.2, bounce=boun, radius=imp})
physics.addBody( well,“static”, { radius=sensorRadius, isSensor = true} )
and setup a local collision
well.collision = inWell
well:addEventListener( “collision”, well )
but when this code executes:
local function inWell(event )
local obj1 = event.other
local obj2 = event.target
if (obj1.radius < obj2.radius) then
I get obj1 is a nil value. Should event.other not return the ball?
[import]uid: 11767 topic_id: 4157 reply_id: 304157[/import]