This is a feature request to give developers more control over the physics system.
Physics layers are a way to stop simulated objects from pushing/being_pushed_by other simulated objects.
One use case would be when you want to simulate a boat that the player character walks on, you would set the boat to a lower physics layer than the character, as you don’t want the character to push the boat if the character walks into the boat’s walls.
Related:
Floating collider moves with player - UE4 AnswerHub (unrealengine.com)
How to stop one physics object from affecting another? - UE4 AnswerHub (unrealengine.com)
Interesting idea, it may be a pain to implement though.
My question is: If the boat has a mass significantly greater than the character (like 100x), then won’t the force applied to the boat be insignificant? (Make sure bPushForceScaledToMass is true on your CharacterMovementComponent.) And if you want nothing to be able to apply force on the boat, you could set the boat to be kinematic, right?
This actually works well enough for what I want but my boat has the mass set to 100,000 and my character to 1. It seems like an imperfect workaround. Since now if I have an explosion I would need to specify how much Impulse characters and boats get separately.
Also, side note, not all Impulse nodes have a Vel Change option.
I am using a simulated capsule for my main character’s movement, but this is good to know.
Well, my current understanding of kinematic bodies is that you need to specify where they are supposed to go. I want to keep the functionality of a simulating body, the way it rotates naturally when it collides with stuff. If the boat hit another boat I would want them to react normally.
I will just set the mass to a really high number for now. But it’s strange that I cant tell a simulating object to ignore the momentum of other simulating objects.
Maybe physics layers wouldn’t be the cleanest way to have control over this, I could imagine having an event before the physics kick in might also get the job done, not sure.
1 Like