Detect when movement stops

Hi,

I am building a game, and I have it so that when my object hits something, it waits an amount of time then disapears (starts again), however I want this to only happen when the object has completely stopped.

Also how do you make an a floor so that when the physics are enabled, the object will eventually slow down, it seems to just keep the same speed forever unless it hits something, which it will then bounce off and whatever speed has left will continue with that speed.

Thanks [import]uid: 72726 topic_id: 14574 reply_id: 314574[/import]

use:
[lua]vx, vy = myBody:getLinearVelocity()

if vx == 0 then
–code[/lua]

to detect if x velocity is 0.
anddrew. [import]uid: 79135 topic_id: 14574 reply_id: 53947[/import]

use:
[lua]vx, vy = myBody:getLinearVelocity()

if vx == 0 then
–code[/lua]

to detect if x velocity is 0.
anddrew. [import]uid: 79135 topic_id: 14574 reply_id: 53948[/import]

Am I right in thinking:

[lua]myBody:getAngularVelocity()[/lua]

Will get the y axis as well, so I can then check if both are zero then I know the object has stopped?
[import]uid: 72726 topic_id: 14574 reply_id: 53952[/import]

vx, vy = myBody:getLinearVelocity()
vx = velocity on x axis
vy = velocity on y axis

read here: http://developer.anscamobile.com/reference/index/bodygetlinearvelocity

myBody:getAngularVelocity() will get the current rotational velocity, in degrees per second. (how fast it is spinning)
read here: http://developer.anscamobile.com/reference/index/bodyangularvelocity [import]uid: 79135 topic_id: 14574 reply_id: 53953[/import]

Thanks for that! Very helpful!! [import]uid: 72726 topic_id: 14574 reply_id: 53956[/import]