I have a ball I want to shoot in the y direction after it rolls over a sensor. I can’t get what I’m doing wrong.
Thanks,
Dan
[code]
local function onVelocity( self, event )
orb:applyLinearImpulse( 0, -200, orb.x, orb.y )
end
– velocity Sensor
local pipeSensor = {}
local sensorRadius = 20
pipeSensor = display.newCircle( 30,30, sensorRadius )
game:insert( pipeSensor )
pipeSensor.isVisible = true
pipeSensor.x = 455 + xmoveplacement
pipeSensor.y = 165 + ymoveplacement
pipeSensor.radius=sensorRadius
pipeSensor.isSensor = true
pipeSensor:addEventListener( “collision”, onVelocity ) [/code] [import]uid: 78446 topic_id: 13820 reply_id: 313820[/import]