Rolling coin Physics

Hi,

I’m quite new to Unreal engine and 3D game dev in general, so please forgive me if I say something stupid :smiley:

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?

Thanks in advance.

Matthew

I may not have this in the correct forum topic, can a Mod please move this to the right place if not :slight_smile: Thanks

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:

Image from Gyazo

I’d definitely start with crafting meticulous collision with bevelled edges. Then enable CCD and up the solvers:

That looks a million times better than what I had.

Looking at your settings, it looks like it is the solvers where I was going wrong. It was the only property I didn’t mess with.

I will use your settings as a guildline and I should be able to get a good start on it.

Thank you so much for you help, and for answering so fast too

Thank you so much for your help, it has really helped me get started with this :slight_smile:

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?

Thanks again.

I played with this for a while and here’s what I’ve tried:

  • linear damping to 0
  • physical material with the following settings:

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:

This behaves differently than the standard 36 face. Better but at this point I think we’re hitting limitations of what PhysX can do.

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.

Thank you @Everynone.

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 :slight_smile:

Thank you so much for your help with this.

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 :smiley: 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 :smiley:

Great stuff, thanks for sharing