Physics: Coin won't fully flip?,Physics + rigidbody coin won't flip more than 45 degrees?

I’m making a very simple coin flip in 3D. There are no scripts running that have any effect on rotation of anything. The coin is flipped by getting impacted by a capsule that moves upwards. The coin is thrown into the air, and it begins to flip… but REFUSES to flip fully head over heels. It turns until it is “vertical”, but then refuses to flip further. Even after it hits the ground, it refuses to flip, and literally bounces upright, until it finally falls back down flat, and lands heads up every time. In other words, because it won’t flip head over heels, it always lands heads up. So the coin is refusing to rotate more than 45 degrees. Yet, there’s nothing running, except a collider, and a rigid body, and unity’s built in physics. There’s also no constraints on rotation. I am super confused at this.

It sounds like the issue may be with the shape of the coin’s collider. If the collider is a perfect circle or cylinder, it may not be able to rotate properly when impacted. You may want to try using a mesh collider instead, which will better approximate the shape of the coin and allow for more realistic rotation.

Another thing to check is the mass and drag of the coin’s rigidbody. If the mass is too high, it may be difficult for the capsule impact to provide enough force to fully flip the coin. Similarly, if the drag is too high, it may resist rotation.

You could also try adjusting the physics material of the coin’s collider, particularly the friction and bounce properties, to see if that has any effect on its rotation.

I did finally fix this… I had to… in a script attached to the coin… in the Start() function, added these two lines:

    this.GetComponent<Rigidbody>().maxAngularVelocity = float.PositiveInfinity;
    this.GetComponent<Rigidbody>().constraints = RigidbodyConstraints.None;

Note: I already had all the constraints set to unchecked in the inspector.

I’m not sure which of these two lines fixed it, but as soon as I added these lines, boom, the coin was flipping perfectly. Pretty sure it’s a bug. This happened in 2022.2.15f1.