StaticMesh with Physics, but without Gravity
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.
asked Jun 30 '14 at 05:05 AM in Using UE4
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.
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 ;)
Follow this question
Once you sign in you will be able to subscribe for any updates here