I’m quite new to Unreal engine and 3D game dev in general, so please forgive me if I say something stupid
I’m trying to create a game and part of the physics for the game is to have a coin roll along a surface realistically.
I am struggling to work out how to setup the physics for a rolling coin.
I have tried multiple variations of properties, tolerances, stabilisations etc. but cannot get it to act like a coin.
The coin either falls over instantly, rolls with too much friction, doesn’t turn (stays a perfect straight line), spins on the spot, wobbles like a clown on a unicycle etc.
Do you have any tips, guides etc. for simulation a rolling coin realistically?
How realistic are we talking? While the default behaviour surely leaves room for improvement, it seems to have a reasonable idea of what a flat physics-driven disc is:
I’d definitely start with crafting meticulous collision with bevelled edges. Then enable CCD and up the solvers:
Thank you so much for your help, it has really helped me get started with this
I did reply before but my comment didn’t seem to appear.
I used the info you have given and I have managed to get the coin to roll in a more realistic fashion (I don’t need hyper realistic, just a good simulation).
The issue that I am having now is due to friction. The coin is slowing down too quick. If I place a sphere the ball rolls indefinitely, however even with a linear and angular friction of 0, the coin still slows down really fast and then falls over.
I need the coin to roll until it either becomes unstable or hits something, do you know where I could be going wrong?
The low friction allows the coins to slip and slide a little as they fall. Not sure about restitution but the default felt a wee bit too bouncy.
Now, the coins still lose a lot of momentum here. This is due to the collider not having enough faces. It’s not as bad trying to roll a hex bolt but it adds up very quickly. A more complex collider is needed, 72 sides might be OK, but for something really good I’d roll, ehm, with 144 sides + bevelled edges:
UE4 cannot create simple collisions like that (or I do not know how to make it do it and convex collision does not work well for this shape) so here’s a coin if you want to try it out:
It has its own fairly complex collision that UE4 will recognise as Simple and allow its physics engine to utilise. When you import this fbx, do ensure to untick Auto Generate Collision in the FBX Import Options.
I’ve been having a good play today and I’ve managed to get some virtually as I want it. I modelled a very simple coin in Maya with very high subdivisions (500) which created a low point of contact between the coin and the floor.
I the used the mesh editor to regenerate the “Convex Decomposition” using, 64 hulls, 32 max hull verts and 100,000 hull precision. This generated a very smooth simple collision which works almost as good as a sphere.
This has pretty much killed the friction which is exactly what I wanted.
The wobble when the coin falls in a little flat (falls like a heavy coin), but that doesn’t impact the usage much so I am happy with it
I the used the mesh editor to
regenerate the “Convex Decomposition”
using, 64 hulls, 32 max hull verts and
100,000 hull precision. This generated
a very smooth simple collision which
works almost as good as a sphere.
Impressive. I’ve always found the collision generation mostly disappointing! Apart from that, wicked - glad to hear you got it to a satisfactory state.
Almost While the collision worked, it became far too intensive for use on mobile and just caused it too crash. I swapped to your coin and used the default collisions and it is working almost perfect. The only slight issue I am having is it is rolling too well, more like a tyre than a coin. I need to try and get a bit more randomness in the balance and then it will be perfect. It’s working well though and well on to getting the prototype for my game ready