# Disable gravity for a single dynamic object in the BGE?

I have a sphere which I use to restore dynamics on objects it collides with (by expanding to cover the shards over the course of the animation); the collided objects are "shards" of a crystal, and the sphere is a ghost so it does not affect any part of the crystals except the state of their dynamics. I have a collision node set to detect collisions with the material of the sphere, but that requires it to be a dynamic object.

I need to make the sphere unaffected by gravity during physics simulation, since there is no way to set the mass to zero, and collisions will not be detected with static objects.

This question has a similar problem, but setting the sphere to a character simply made it glitch out and not expand correctly.

• To lock rigid bodies/dynamic bodies in place you could use rigid body joints or use "Lock Translation" in the physics panel. Interestingly you cant lock dynamic bodies with the latter which looks like a bug. But a rigid body joint (generic 6 DoF) should work in both cases. Since "no gravity" and locking something in place is something different let me know if this is a solution for you. – user2859 May 9 '14 at 7:10
• Tried that one too but it just didn't like it. Also, the sphere's animation requires moving along the z-axis slightly, so even if it did lock it might not work. – einsteinsci May 9 '14 at 8:01
• You could also parent it to a no collision object (without any constraint). – user2859 May 9 '14 at 9:11

Connect an Always sensor to an And controller and this last one to a Motion actuator, with a value of 9.8 * mass (where mass is the value for Mass, set in the Physics tab of the Properties window) for the Z axis.