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!

Something like this should do the trick;

1
2
3
4
5
6
local function checkVelocity()
vx, vy = obj:getLinearVelocity()
  if vx < 40 then
    obj:removeSelf()
  end
end

Thank you so much, that did the trick!!

Not a problem :)

views:1321 update:2011/12/29 9:44:01
corona forums © 2003-2011