Collision sensitivity?

I’m trying to check if two meshes are overlapping, really overlapping, but collision is so sensitive that even if those meshes are just touching each other, the collision is detected as an overlap, not just a hit. Is there some settings I can use to reduce the sensitivity of this collision?

If I remember correctly, no. Tolerance can be used in comparisons of float variables, but that is all. But you can create logic to calculate and remember the distance for each tick to determine how much overlap there was.

You can put two meshes with one slightly smaller and inside the bigger one. When inner meshes overlap you count it as a full collision. When outer ones overlap you count as a light touch.
doubles your collision calculation cost though…

Could work for really simple shape like cubes but using function to check the distance of thousands of hit points would be crazy

I already tried this but it doesn’t work with all shapes.

Let’s say you have 2 Lego parts like this
Lego

You can put one on top of the other because there’s 2 holes under those parts with the shape and size of the 2 cylinder on top.

If you put them exactly on top of each others, even with best and most complex simple collision (complex collision doesn’t trigger overlap events) and then check collision in UE, it will detect an overlap even if those 2 parts are just barely touching each other but not really overlapping

If you make a copy of this shape, add it to your rendered mesh, scale this shape down at something like 90% of the scale of your rendered mesh and then use it as your collider, the 2 cylinder on top will be smaller and will fit in not scaled holes but the two holed under those parts will be smaller too.

1 Like

Most of games are using simple shape as collision. If there is a need to precision, they usually make each different solution based on each detailed situation. I wonder what your detailed situation is. In many cases, hit point and hit normal vector, and some trace check is enought. But your situation sounds special. As you know, game development is the process to make from things looks crazy to things looks possible, with divide and conquer :slight_smile:

That sounds interesting. ok. It looks fun. If I get the problem like what you said, I will make collision model with small upper cylinder and large holes at the bottom, that is seperated with visual model :smiley:

Or, I could think of a set of collision meshes that are activated only when the distance approaches. That can be change the shape by moving each small parts of collision.

As the distance increases, the upper pin becomes smaller and the lower hole becomes larger. As the distance gets closer, the size difference between the two decreases. To do this, you will need to use a combination of collision meshes of different shapes and sizes. For example, if you combine several boxes to surround a cylinder, you can use them as a hole that couls be changed its radius.

And, with proper trick or logic, maybe you could change the thousands things to dozens. Usually I handle problems in this way. several sphere or boxes can be used to mimic more complex shape.

You can consider to use physics functionality of engine, but even there, maybe you would need to aproach like this. But there seems that there are more various options.

Sometimes changing the approach direction of thinking could be helpful. In your imagine, how that “sensitivity setting” work? What is the logic that “sensitivity setting” use?

That’s a lot of wonky workarounds to replace a simple setting and like I said, it would be a nightmare for complex shapes.
This setting exist in almost all modern game engines, in Unity it’s named “collision tolerance” Property CollisionTolerance | Unity Physics | 1.1.0-pre.3

1 Like

It’s good to know that I did not know before! An experience like this makes me happy :smiley: Then, my another question arises. How does work that setting in the Unity engine? Ok, I know that the source code of Unity is not open to customers. Then we have to think about it. If you can mimic that in Unreal Engine, you will get what you want. I will bet that some “nightmare” thing is happening inside the Unity engine, with some “trick”. Maybe the name of that trick is “math”. If I were you, I would investigate the source code where game engines handle collision. At least, we can see the source code of Unreal and Godot.

Or, how about dynamically dividing and checking the spaces of mesh with small voxels?

Hey. We know that sometimes (maybe more than that?) game development makes us painful and angry. And some (more than that?) aspect of the Unreal engine is ridiculous and hard to accept. But when we analytics, and investigate problems, And when we divide them to more little smaller and litter easier things, that pain and difficulty also become a little easier. Then someday, we can make them to a group of things we can handle. I hope that I can see you that feeling a good achievement mood after you solve this. To do that, you have to divide this problem into a group of little easier problems.

I want to note that I don’t have much knowledge about the physics part of the Unreal engine. So there is a possibility that there is a proper option there.