How can I stop my Physics Body from being affected by other Physics Bodys without constraining movement?
MyCharacter from Side Scroller template had Collision Presets set to Pawn and disabled "Collisions Enabled", which made other falling objects just fly through my character, completely ignoring it. So I changed Character's collisions to custom preset and and then "Collisions Enabled" to "Collisions Enabled".
The rest of the objects now collide with my character even when they're WorldDynamic or PhysicsBody. But there is one bad thing with this solution (bad in my case)
In my game each object has it's own Vector3 gravity, so I can control if it falls down, flies up or sideways. Player can just control whether object falls down normally or has "inverted gravity" and flies up. Example setup:
1 - Character with "No Physics Collision". Player shoots platform - it flies up. Player can walk around that platform with no problem.
2 - Character with "Collisions Enabled", same thing but platform's rotation get's affected by mass of character. Clumsy player falls off platform:
Of course I understand that this is how physics work. But can I apply these two into my character:
One answer would be to constrain object's rotation but I would like to avoid that. I'm already constraining all physics objects to 2D plane (movement on Y, Z and only one rotation)
You might want to consider using matinee to move your platforms, and basically fake your gravity change. Otherwise, constraining the rotation is probably the best option. Setting your character's mass to 0 might have other unintended effects on your game.
If you'd like, I can take a close look into the issue if you show me specifically how you are moving your platforms up and down so I can reproduce it.
answered May 16 '14 at 05:35 PM
for 1) doesn't the standard pawn collision preset work? 2) To set the mass to 0 kgs, expand the physics tab by clicking on the arrow and set mass scale to 0 or you can just search for mass scale and set it to 0 for the mesh and capsule component.
answered May 16 '14 at 05:10 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here