Question about impulses

Hi! I have an object that has linear impulses applied to it, although, they don’t seem to work like I’ve coded them to. I want them to go in the direction of the impulse, regardless of the gravity. If the impulse is on the bottom of the object, the object should go up, and if the impulse is on the top of the object, it should go down, etc. I can’t seem to get this just right. Please, and thanks! :smiley:
[lua]local obj = display.newImage(“obj.png”)
obj.x = display.contentWidth/2
physics.addBody( obj, { friction = 1.0, radius = 75 })

function moveObj(event)
obj = event.target
obj:applyLinearImpulse( 0, 0, event.x, event.y )
end

object:addEventListener(“touch”, moveObj)[/lua] [import]uid: 25216 topic_id: 14104 reply_id: 314104[/import]

I think this is what you are looking. Object’s reference point must be set to center.

function onTouch(event) local target = event.target target:applyLinearImpulse(target.x - event.x, target.y - event.y, target.x, target.y) end [import]uid: 46529 topic_id: 14104 reply_id: 51928[/import]

Thank you so much! It moved too fast, but after I added some density, it worked fine. Thanks again. [import]uid: 25216 topic_id: 14104 reply_id: 51940[/import]