Search Issue Tracker
Won't Fix
Votes
4
Found in
5.5.0p3
Issue ID
868124
Regression
No
RigidbodyConstraints are ignored when rotating object with some ForceMode's
RigidbodyConstraints related to rotation doesn't work correctly when trying to rotate object with some ForceMode's. A little bit of rotation is still applied even when constrains are enabled.
To reproduce:
1. Open project.
2. Inspect the script attached to gameobject in the scene.
rigidBody.constraints = RigidbodyConstraints.FreezeAll;
yield return new WaitForFixedUpdate();
rigidBody.AddRelativeTorque(new Vector3(0, 0.5f, 0), ForceMode.Acceleration);
yield return new WaitForFixedUpdate();
Debug.AssertFormat(rigidBody.angularVelocity == Vector3.zero, "{0}", rigidBody.angularVelocity.y);
3. Enter play mode.
Note: You can see in the inspector that the object rotates a little bit and then stops.
4. Exit play mode.
5. Comment line "rigidBody.constraints = RigidbodyConstraints.FreezeAll;".
6. Enter Play.
Note: You can see the same results even though constrains line is commented out.
Expected results: No rotation.
Actual results: Rotation occurs.
Important notes:
1. Same bug occurs when using "RigidbodyConstraints.FreezeRotation" instead of "RigidbodyConstraints.FreezeAll".
2. Same bug occurs when using "ForceMode.VelocityChange" instead of " ForceMode.Acceleration".
Reproduces with: 5.3.6f1; 5.4.3p3; 5.5.0p3; 5.6.0b3;
-
katrinamain
Mar 17, 2023 10:36
Comment
-
big_3
Jun 13, 2017 20:43
I have the same problem. Did you find a Workaround?
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Red spots appear when Blending Lighting Scenarios using Adaptive Probe Volumes
- [Windows] About Unity Window needs to be opened twice to adapt to resolution
- NullReferenceException and temporary graph corruption after entering playmode if output node connection was changed
- Sprite Renderer with Animation does not reflect Sprite changes in the Scene when switching Mask Interaction
- User is redirected to a non-existing online documentation link when clicking on "?" help button inside Inspector window while Animator Override Controller is selected
Resolution Note:
Rigidbody Constraints have some limitations that can't be easily solved. In such occasions it's recommended that Joints are used to lock the object instead.