What I’m trying to do is when a finger touches the screen(anywhere) it makes an object constantly float upwards in a linear fashion until the finger is removed from the screen. When the finger is removed the upward impulse is removed.
This is obviously wrong, but you can see what I’m trying to do.
[lua]function floatUpward(event)
while event.phase ~= “ended” do
myObject:applyLinearImpulse(0,-0.5,myObject.x, myObject.y);
end
end
Runtime:addEventListener(“touch” , floatUpward)[/lua]
Can anyone help? [import]uid: 48009 topic_id: 8653 reply_id: 308653[/import]