How to stop tiny physics objects from falling through the floor?

So I have a to scale 1 Yen coin, and it falls through my landscapes and floors.
I already know the issue it because its small but I don’t exactly have the option to scale it up.
I’ve tried enabling CCD, and that works until it falls on its side.
Any tips would be appreciated! :slight_smile:

Diameter 20 mm

Thickness 1.5 mm

EDIT: I’m gonna put some known but not reasonable solutions here.
~ Increasing the thickness of the floor or place a blocking volume just below it.
~ Scaling the entire game up.

2 Likes

If it’s just one object then maybe you could fall back to a ray-cast.
If falling do a test towards the floor. Check the distance to the floor & acceleration and if the next frame would have it fall through maybe force the coin to instantly sleep the physics and move it’s bottom to the ray-cast hit position.

It’s not perfect and would be taxing if there are many coins but I’ve seen it’s quite the problem in other threads

Sadly I’m using these as money drops. There could be quite a few in-game at a time.

I might check it out if it seems like my last option, Thank you!

Did a quick test based on an old project and seems pretty stable.

Still need to test it on landscapes but solid objects seem to work fine

Do you plan on rolling the coin in any way? You could do a predict physics path on spawn then do a test in the path and see it goes through the terrain on the last point (do a raycast from up above and test if the path goes below the hit point). If the path is below then just cut it at the intersection point and animate the coin along the prediction path.
it will have the correct look physics wise and will probably eat less computational cycles.

The main culprit from short tests is the terrain. Increasing physics substeps to 16 helps a bit bit at steep angles the coin falls through

Yeah, solid objects work perfectly, sorry I forgot to mention that. (non-landscape)

As for your other reply, would it still bounce correctly? Also, do you have any resources on this technique? Because just reading this, I’m not quite sure how to start. (then again I’m tired as all hell, maybe it’ll make more sense to me when I reread it in the morning.)

I just chatted with someone about collision and it may be similar or on the same level as this…

Is the actor’s collision setting using query and physics?

I’ve have this issue before with small hand grenades falling through the floor and it was from a combination of blocking collision settings with the landscape and the actors not running query and they were basically ignored by the landscape despite collision settings blocking all on both the actor and landscape…

With chaos, I wouldn’t even attempt it.

With physX the solution is to change the rate at which physics are calculated.

Your problem is that the coin is small. The floor is obviously too small.

The speed at which the coin is moving is causing the collision calculation to fail.

Having more calculations happen is normally an ok sulution for it.

Still, a thicker floor will do the trick almost as well.

Take the smallest side, multiply it by the speed at which its falling.

Each frame, the floor has to be thick enough to cover that value for a response to be able to occur…

1 Like

Mesh floor is not a problem. The problem arises when you do small collisions on landscapes.

Same thing.
The landscape particularly uses a very thin collision. Which is why lots of things tend to fall through landscapes.

It should have an option hidden somewhre to extend the collision area of it btw. Its one of the super hidden settings or something similar.

I’m guessing landscapes also has many optimizations that make it behave radically different to other physics entities (dynamic LOD and collision rebuilding that probably takes place).

You can increase collision thickness in the landscape it’s a parameter.

No, because none of that is realtime.
Its just computed by the editor so once its painted as you wanted, it remains that way.

The "lod"s for it are actually just based on the landscape components, and they have some of the worse possible math for the transition effects.

Still, none of that changes the physics…
The collision is pre-calculated after you exit the landscape editing mode.
That’s about all there is to it…

How does one change the physics calculation rate?

1 Like

Increasing the landscape collision thickness doesn’t seem to help.

Why is it so pivotal to simulate such small coins though? Is it crucial to gameplay? Maybe there is a different way around the problem other than technical?

Well, everything in my game is set to real-world scale, so I figured the money should be too.
I actually wouldn’t mind too much scaling them up a tad, but they still fall through landscapes even when at <15x the scale.

I plan on having events and enemy interactions around these coins, the player can even throw them. I was planning on having them be pretty involved in the gameplay and the game itself.

I’m quite open to discussing ideas if you have any tho.

Check physics dub step settings and similar.
Increase the rate to .3 or so… try different numbers.

Maxing everything out (Max substep DT: 0.0013 & max substeps 16) causes it to not fall through only 90% of the time and always fall through if moved again.

But with Max substep DT: 0.012, max substeps 6 & CCD turned on, It won’t fall through.
The downside, CCD makes it act quite unusual. (Spinning violently)

You can try simplifying the collision shape to a box (simple collision should be less prone to fall through).
If you are using CCD then I would suggest turning off collisions between many coins (add a new collision layer and ignore coin => coin collision) it massively impacts performance otherwise with many coins.

Still no magic bullet to make it work a 100% of the time

I started messing around with niagara particles, and it seems the CPU collision they use works perfectly.
Now I’m trying to find a way to script logic around them (Not looking too good :frowning: ).