Seams between floor tiles produce collision/physics artifacts when rolling over them
In my project I am shooting and making balls roll on the floor using the built-in physics system. Everything was working nicely while I was using a big seamless plane as my floor, but the moment I started building real levels with floor tiles the balls began "hitting" the seams between the tiles and jumping around. I have tried placing the tiles as well as I could, with a little gap between the tiles or with a bit of overlap with no difference. I have also tried using simple (bounding box) and complex collision for the individual tiles. Here is an example pic:
As you can see, the ball trajectory is traced in green and there are two tiles in the floor. When the ball rolls over the seam between the two tiles it suddenly jumps into the air.
Any ideas? Thanks.
asked Nov 04 '14 at 10:43 AM in C++ Programming
For the sake of spreading the information; I did find a thread discussing the subject and according to staff the problem is tied to a limitation in the engine, and there isn't really anything that can be done about it.
answered Oct 07 '15 at 10:13 PM
I found a solution for this in Unity, I'm sure it's also applicable to Unreal:
Make a giant collider on top of your "bad seams colliders". This is the collider you will actually collide with. It can be much larger than the actual area of the If the seams collider is a Mesh collider, typically the "good collider" will be the same mesh with a convex simplification (not sure how to do this in Unreal, but it's a checkbox on the mesh collider in Unity). Otherwise just make a giant, simplified box collider overtop of your bad seams. When your on top of a collider with seams, you collide with the "giant" collider, otherwise you fall through the giant collider.
In detail: Put the convex/giant collider on a "seam fix" layer, and the other collider on a "seam bad" layer. Have 2 physics layers (not sure how these work in Unreal) for your player. One is the regular player layer, the other is the "player seam fix" layer. Setup your layers so your player layer collides with "seam bad" but not "seam fix" and "player seam fix" collides with "seam fix" and not "seam bad".
In Update, use a BoxCast/SphereCast/RayCast or w/e to determine if your on top of the "seam bad" collider, if you are switch to "seam fix" else stay on player regular. Switching to player regular when your not on the "seam bad" collider ensures that you fall through the simplified collider when your not touching the "seam bad" layer.
The "seam fix" layer is a simplified collider without the seam problem, so this script essentially makes it so you only collide with the giant collider if your on top of the bad seam collider and allows you to fall through the giant collider otherwise.
It's working very well for my game with a physx rigid body character controller.
Here's an update on this situation, for future viewers.
There is an option in the Project Settings called Contact Offset. Project Settings -> Engine-Physics -> Simulation. There are three settings for contact offset. Contact Offset Multiplier, Min Contact Offset, and Max Contact Offset. I lowered the min and max offset values to get a much better response in the collision behavior.
Here are my settings:
My settings are just a shot in the dark. They may not be the most optimal settings, since I actually do not completely understand what the meaning behind each value is. The matter of the fact is that they will eliminate this ugly bouncing on collision mesh seams that happens by default.
Thanks to some lovely folks on the forum for discussing a good solution: https://forums.unrealengine.com/development-discussion/content-creation/50364-rolling-ball-jumps-on-flat-surface
answered Dec 21 '17 at 07:34 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here