Indeed, as @ross.grams said, by changing gravity either in game.project or in some function.
You are disabling the same #collisionobject
twice in one function (update). Is it for purpose?
You probably want to disable collision object of type Kinematic, e.g.
msg.post("#collisionobject_kinematic", "disabled")
and enable collision object of type Dynamic, e.g.
msg.post("#collisionobject_dynamic", "enabled")
when you want the game object to behave dynamically, which means, all collisions, rotation and position handling will be performed by Box2D (physics engine), without your intervention (except calling apply_force
). But I would suggest switching collision objects only in the particular case, when you need it and after the case is finished, switching it back to kinematic. Or create only dynamic collision object and change position by applying forces