velocity question

what i have been trying to do is if the velocity of an object that is less than 40 in the x direction then i want it to removeSelf(), how do i accomplish this?? thanks! [import]uid: 38977 topic_id: 19430 reply_id: 319430[/import]

Something like this should do the trick;

[lua]local function checkVelocity()
vx, vy = obj:getLinearVelocity()
if vx < 40 then
obj:removeSelf()
end
end[/lua]

Peach :slight_smile: [import]uid: 52491 topic_id: 19430 reply_id: 75008[/import]

Thank you so much, that did the trick!! [import]uid: 38977 topic_id: 19430 reply_id: 75140[/import]

Not a problem :slight_smile: [import]uid: 52491 topic_id: 19430 reply_id: 75217[/import]