Rolling ball jumps on flat surface

Hello everyone :slight_smile: ,

I’m a beginner with the Unreal Engine 4, so I wanted to create a very simple platform game where the player controls a ball,

But I have a problem, sometimes the ball jumps even on a flat surface :

https://www…com/watch?v=rzyNTmDpJaw

For the collisions I use a box simplified collision :

And this is how the collision looks like on the map, as we can se there’s no “space” between the boxes :

4b28366b09fcb5a9c8ae02d17c551824cff86cb4.jpeg

Can someone explain to me why the ball is jumping and how I can fix it?

Thanks for your time!

(Sorry for my English, I’m French).

What’s the ball collision set to? it seems like it’s hitting facets somewhere
And you’ve made sure all of your boxes are exactly the same Z height correct? I see the Z is set to 569.9999939 on the selected one, if they’re off even by a little you can get a pop pretty easily

Thanks for your reply :slight_smile:

The ball uses a “Sphere simplified collision”, I also enabled “CCD collision” :

I changed the Z to 0 for all my boxes, but it doesn’t change anything, the ball is still jumping.

I’m thinking that it is still seeing the edge of the boxes as being the problem, it might be a good thing to try and make a single collision box that encompasses everything in a row, and see if it still bounces. maybe stretch one box to be the whole length and see if the ball still bounces, that should tell you whether it’s the spherical collision or the boxes

Sorry for the double-post, but I wanted to add something.

I don’t know if it may help you, but this time I tried something different.

I deleted all the blocks and I created a landscape using the “Landscape” tool, I didn’t change anything on the landscape:

https://www…com/watch?v=-CzgQMRA5Ns

As we can see the ball is still jumping, so the problem is maybe the ball, here are the details of the ball:


As I said on the previous comment, the ball uses a “Sphere Simplified Collision”.

Best regards,

.

edit : I didn’t saw your previous comment Visnarel , I’ll try it, thanks :slight_smile:

Hi everyone,

This is a known issue and has been reported as UE-16238. I am going to update the bug report to show that more developers are affected by this.

Thanks for your reply :slight_smile:

So the only thing I can do is to stretch one box instead of using many boxes (I tested Visnarel method and it works).

Thank you everyone for your time and have a great day. :slight_smile:

Double post removed

Just discovered this issue by accident, and realised that I am experiencing the same issue with a skateboard simulator as well. The wheels of the skateboard are primitive sphere colliders, and as they roll, they seem to catch on the internal edges of the collision mesh(es). See the video below, but it is basically the same issue as what OP is reporting. Physics substepping is enabled. Happens randomly, and speed / angular velocity of the sphere does not seem to matter. Have tried many things, but have not yet been able to make the random “popping” on edges go away.

Has there been any updates to issue UE-16238?

https://.com/watch?v=CZhYRBs9qN8

Thanks!

In case anyone doesn’t know, the option in 4.13:
project settings → physics section → max contact offset
seems to fix this. Set the number lower to prevent the bounces

Just replying to this old thread, since i found it from googling the problem, and hopefully this will help anyone else with the same issue

3 Likes

[=11007;599547]
In case anyone doesn’t know, the option in 4.13:
project settings –> physics section –> max contact offset
seems to fix this. Set the number lower to prevent the bounces

Just replying to this old thread, since i found it from googling the problem, and hopefully this will help anyone else with the same issue
[/]

This mostly resolved my problem. Thank you very much for taking the time to post here with the solution! :slight_smile:
I chose a Max Contact Offset of 0.125. Will test that for a while.

1 Like

Hey I’ve been working on a rolling ball game as well, and have been running into similar issues. One way I’ve been able to work around the problem is to create a large cube that encompasses the area and use that as the collision - set the in game visibility to hidden, or make a transparent material to apply to several of these collision boxes. Then for you flooring set their collisions to No Collision. Smooth Ride. I know this is an old thread, just thought I’d share what I’ve come up with.

[=“11007, post:10, topic:37461”]

In case anyone doesn’t know, the option in 4.13:
project settings –> physics section –> max contact offset
seems to fix this. Set the number lower to prevent the bounces

Just replying to this old thread, since i found it from googling the problem, and hopefully this will help anyone else with the same issue
[/]

I love you, because this worked. I also changed Min Contact Offset. Here are my values:

  • Contact Offset Multiplier = 0.02
  • Min Contact Offset = 0.01
  • Max Contact Offset = 0.05

I don’t know if those values are overkill, but it completely helped with my rolling ball collision behavior. No more erratic bouncing on flat surfaces!

2 Likes

As of at least 4.21 this no longer works, and the ball will jump when rolling over the seams. I can’t seem to get any combination of values to provide the desired results.

Bump, is correct!

I have the same issue - after hours of googling I still don’t know what to do here

[=“anonymous_user_bcdf2077, post:14, topic:37461”]

As of at least 4.21 this no longer works, and the ball will jump when rolling over the seams. I can’t seem to get any combination of values to provide the desired results.
[/]

Yeah, that fix no longer works, had to get very creative to get around it in the physic vehicle project I am doing.

I’m on 4.20.3 and changing those values doesn’t seem to do anything either.

Could it be that the surfaces are being triangulated by the engine? Maybe setting the mesh/surface not to deform and or, keep quads, will reduce additional geometry? If the physics are correct, enough velocity will introduce aerodynamics. Perhaps giving the ball a Physical Material of lead :).

Just occurred to me, have you tried raising the value of gravity?

I can also confirm that the behavior has changed from 4.19 onwards and MaxContactOffset only has a limited impact. Looking at the source code it seems the problem comes from a line in FBodySetupShapeIterator::ForEachShape in BodySetup.cpp. In 4.19 it looked like this:


const float ContactOffset = ComputeContactOffset(Geom);

And in 4.20 it is this:


const float ContactOffset = FMath::Max(ComputeContactOffset(Geom), RestOffset + 1.f);

So the contact offset will never be able to go lower than 1 + whatever RestOffset is. I reverted this particular line of code with theone from 4.19 and that seemed to fix the problem.