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!
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.
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
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…
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.
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.
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 ).