Object rotates despite axis is frozen

I am trying to make a 3D game in Unity. There is an object that has a frozen axis, but the object slowly rotates on this axis. I have a small demonstration video, you can see there that I don’t use any scripts (my movement script is disabled) and my Y axis is frozen:

I will extremely appreciate any help.

I can replicate this, looks like a bug. I tried dropping a standard cylinder (scale 1, 1, 1) on to an offset step and with the right positioning I could get it to slowly roll down the step, even though it had a y freeze (roll, not slip - transform rotation and angular y velocity on rb).

If all 3 rotations are frozen it behaves as expected - absolutely zero rotations.

Switching the Edit → Project Settings → Physics → Solver Type to Temporal Gauss Seidel greatly improved things (no post impact rolling), but a few degrees of rotation were still apparent after the impact.

It’s ugly, but you could run a FixedUpdate script to reset the desired rotation. Or play with the physics settings a bit more to see if you can get something that is “good enough”.

Thank you very much for your reply! I have tried the workaround you suggested but my object moves very strange with it:
private void Update()
{
transform.rotation = Quaternion.Euler(-90, transform.rotation.eulerAngles.y, transform.rotation.eulerAngles.z);
}

I will submit this behavior as a bug and will see how it goes. Will let you know.

Best Regards,
noobUs3r

If you move a rigidbody like this (transform.rotation), then you are effectively teleporting it - the rotation is in no way controlled by the physics engine or constrained by the Freeze options.

If you have a kinematic rigidbody, you should be using Rigidbody.MovePosition / Rigidbody.MoveRotation

If you have a non-kinematic rigidbody (as I believe you have and which I tested), you should be moving it with Rigidbody.Add[Force/Torque etc] or allowing to freely move under external forces, check the public methods here Unity - Scripting API: Rigidbody

When you do move/apply force to a rigidbody, you will nearly always want to do it in FixedUpdate (physics step) and not in Update (frame render step), be aware of this: Unity - Manual: Order of execution for event functions although, IMHO it is not perfectly correct in all that it implies, it is a good visual of what is going on.

So this is a response from the support team:

Doesn’t really make sense to me to be honest…

Not the best response really. Going back to the replicator I made for the dropped cylinder, all I can say is that switching to Temporal Gauss Seidel helped, but still left a small rotation from the initial collision - perhaps this is regarded as an acceptable compromise for the simplicity of using infinite inertias to control degrees of freedom.

it causes issues, I have rigidbodies with a script to move them forward and nothing else, but they start accumilating Y rotation, I’m guessing because of friction with the ground and soon their forward is no longer correct.