Why is my part colliding here and how can I resolve it?

Hello - I am currently working on a proto-type game with a friend an I’m having some issues with how collisions work. I’m using roblox default physics. (Sorry for the quality of the following gif, hopefully you can withdraw my point from it)

https://i.gyazo.com/4a1599f4f378538ca3daf457be68c903.gif

In the above gif you will notice the ball diverges from its path moving towards the hole and suddenly begins running across in a straight line. What you cannot see infact is the invisible collider which is causing it to run across this line. Next image

Now as you can see I’ve created a collision map on the surface to make sure the ball collides correctly. Since the hole is simply a cylinder negated through a block (so the ball will just ride directly over the cylinder) So I was forced to make a collision map. The first thing you may as is if the collision map has a gap, or a slight bump in height and the answer is no. Next Image

https://i.gyazo.com/e078fff0ee022f937e3523448fcc9051.gif

This is the collision map on its own isolated from the map, and as you can see; it does not have and gaps and it lines up perfectly. I was already sure of this, I double checked and the collision map is entirely correct.

So that means my issue has to be the fact the ball is for some reason going alone with this line that has no bump, no gap - nothing. Its perfectly lined up with its nabour. Does anyone have any fixes for this?

  • Will overlapping them slightly resolve the issue?
  • Is there a way to make the union collision box more accurate to its actual shape with the hole?
1 Like

as far as i know thats just roblox collisions… sorry you either have to union that, or make it a mesh (or you add small lips or something like that)

I can’t make it a union because thats what I need this collision map for in the first place.

If I make it a union then the collider for it completely ignores the hole because the whole box becoems a massive collider, no matter what Collision Fidelity I have it set as. See image

This is with the exact same collider, but unioned. (Same for all 3 types of Collision Fidelity)
https://gyazo.com/a9689f06231453b8501918d273c81c9f

1 Like

then you still have the option of making it a mesh, by exporting the model as an obj, pull it into blender and make it one part, and then import it back to studio

1 Like

Unions and meshparts use approximated geometry for physics. There is a studio setting that shows collision geometry. I personally use a plugin to toggle the setting. “Show Decomposition Geometry”

It is likely that the approximated physics is simplifying around the hole so that the ball will roll over parts of it. Do not use Hull or Box collision fidelity or the ball will always role over it. If it still doesn’t work, you could make sections of the hole, such as each corner, and hope that approximated physics geometry is closer to exact. You could also make the hole bigger, or make the hole part CanCollide false entirely.

Suppose mesh colliers aren’t a thing? Guess they’re very expensive on the client and would really incur performance issues.

The thing is, I think you missunderstand my issue slightly. The union part isn’t actually collided at all, the only collisions the ball experiences are those below:
https://i.gyazo.com/e078fff0ee022f937e3523448fcc9051.gif

But for some reason even though these 4 parts have an absolute 0 gap between them and they are all perfectly the same height. This happens:

Ball follows the edge even though height is the same as the part its currently on:

Ball slows then it hits the edge even though height is the same as the part its currently on:

You see how the ball collides with the part as if it were raised slightly? This only happens at slow speeds. Anything above VERY SLOW this doesn’t happen. But in my game’s context; this is a big issue since it happens in such a vital area of the map.

  • Expected:
    The ball rolls over the seamless gap as if it were just a contious flat surface
  • Actuality:
    The ball seems to run across the seem if its angled correctly and going slow enough. It acts like a lip.

You can check your unions’ physics collision models by toggling this on in your studio settings
image
Make sure to turn it off though. It’s definitely not the kind of setting you want on appearance wise.

Unfortunately this issue is a limitation of the physics engine (and not exclusive to Roblox). Your ball is in fact colliding with the edge of the part, despite both being at the exact same height. We are exploring ways to alleviate this problem, possibly by adding parameters that edit contact collision thresholds, but can’t promise anything soon.

One thing you could try that may help is to scale up your game and lower the gravity. This should at least make the problem happen less often.

You can also try to continue exploring with Unions of parts that eliminate as many seams as possible while keeping the golf hole. Like others mentioned, when working with unions and other mesh parts you can view the collision geometry with the ShowDecompComposition option in Physics Settings (There is a plugin in Physics Best Practices that makes it easier to toggle this option on and off).

Another solution would be to use collision groups. The ball could be always rolling on one giant part that goes over the whole course, then swaps to not collide with the giant part when over the hole. Maybe this solution could be combined with Unions.

Hope this helps!

6 Likes

Thanks for the informative reply, I was honestly hoping it was something on my end that would be easy to overcome, I’ll have to try some trickery with Unions to minimize as many seams around the hole myself whilst keeping track of the collisions its creating.

I do however like the suggestion of collision groups as I could check for if the ball is moving at the slow speeds that typically has occurrence of this issue and allow the ball to use the seamless collision box if not directly over the hole.

Thanks for the help! I’ll look into some solutions!