3
$\begingroup$

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.

$\endgroup$
  • 1
    $\begingroup$ 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. $\endgroup$ – user2859 May 9 '14 at 7:10
  • $\begingroup$ 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. $\endgroup$ – einsteinsci May 9 '14 at 8:01
  • 1
    $\begingroup$ You could also parent it to a no collision object (without any constraint). $\endgroup$ – user2859 May 9 '14 at 9:11
3
$\begingroup$

In order to make an object "not have" gravity, you can move the object up at the same speed gravity pulls it down.

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.

$\endgroup$
  • 1
    $\begingroup$ In the future, please explain your answers better and use images if relevant; see my edit and make your answers in that general format. $\endgroup$ – someonewithpc Mar 8 '15 at 0:45
  • $\begingroup$ Sure thing, I will snap a screen shot or use a paragraph? $\endgroup$ – BluePrintRandom Mar 8 '15 at 1:03
  • $\begingroup$ I found a workaround a while ago, but I tried this just now and it worked too. $\endgroup$ – einsteinsci Mar 10 '15 at 23:23
-1
$\begingroup$

Or you can just take the easy way out, and move your objects along the Z axis as well as the Y and X ones too, giving the ¨Zero Gravity" effect.

This is also great for making a space themed game, easy and fast! :D

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.