Objects in Box2D go to sleep after they calm down. After changing parameters, such as gravity, you will have to wake up sleeping objects, probably causing WakeUp for all objects. Objects are also automatically woken up when something collides with it, so gravity seems to take effect after something collides with the object.
yiding
source share