Game logic with Dynamics
Set the object physics to dinamic.





In logic editor add:

always sensor > AND > Edit object suspend Dinamics

collision sensor > AND > Edit object Restore Dinamics




Note: i used delay sensor to test but you need an collision sensor as in the next img.


With Python script:

add an always and collision sensor to a python controller.




Text.py

from bge import logic

def main(controller):
    colsen = controller.sensors['Collision']
    if not 'init' in controller.owner.getPropertyNames():
        controller.owner.suspendDynamics()
        controller.owner['init'] = True        
    if colsen.positive:
        controller.owner.restoreDynamics()      

main(logic.getCurrentController())


Related Documentation