DragRigidBody script autorotate/freeze rotation

Hello community,

Im using drag rigid body script and so far i have used freeze rotation to make objects what i move “froze” but i noticed that if i drag object at FPS and move it let say 180 degrees X axel the book dosent rotate, okey Freeze rotation works but i came up idea , how i can freeze only Y axel? i still want my objects to rotate while moving but i want disable Y axel rotation.

Any ideas?

Every frame in the LateUpdate, tell it that it’s localEulerAngles.y=0 and the angularVelocity.y=0

Thanks, im gonna try this. I will update you about does it work

There’s no need for that; you can just set the rigidbody’s y axis rotation only. Use the checkboxes in the inspector, or use rigidbody.constraints = RigidbodyConstraints.FreezeRotationY in code.

–Eric

Dosent work :confused: