StaticMesh with Physics, but without Gravity

Hi,

I have a StaticMesh which represents a padlock. This mesh is “attached” to a gate (it is not attached to a static mesh that represents a gate, I mean that a gate is locked with this padlock). Now I’d like to simulate physics, so padlock behaves correctly when we hit it with something. I enable “Simulate physics” and that works ok. But a padlock falls off to the ground. And it should hold on to that gate, it shouldn’t fall off until player unlocks it (until player smacks it and breaks it). So I disabled gravity for the padlock, but now it behaves really strange. Like in zero gravity - it just flies through space. How can I fix that? I’d like that padlock to “keep” itself to the gate, but also simulate some physics when player hits it. And until player breaks the padlock, padlock shouldn’t fall off.

I knew there is another way to do that. Thanks, I’ll give it a try!

Think about what you are doing:

If you give a mesh physics, it will fall to the ground. If you give it zero gravity, it will float off in a whatever direction - just like in the real world. You want to constrain it and attach it to the gate. There are examples of this in the sample content.

https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/Physics/1_5/index.html

A common game hack though, is to use a static / skeletal mesh, and actually replace it with a physics mesh when it comes for it to fall off :wink: