- Home /
How do I stop unwanted rotations?
My object currently has forward force applied to it all the time, and sideway force only when a key is pressed. When i play my object kept rotating on it`s Y axis, it shows on the transform tab in the inspector, it`s very very slow but it`s noticeable. The ground that it`s on is flat, and the object itself is a cube. i`m still new at this, can somebody help me?
Answer by Akusan · Sep 06, 2017 at 08:52 PM
On the Rigid body component, there's a constraints section where you can freeze rotation or position. Just freeze your desired rotation, play around with it until you get desired results
Answer by IRF1 · Sep 07, 2017 at 04:06 AM
I don`t want to stop all rotation and by freezing an axis my object won`t rotate even when it hit another object. The Rotation i`m having issues with is a rotation that happen for no reason, when my object go forward it also rotate in the Y axis a little bit but continuously, and that`s what i want to stop.
Are you using the standard asset character controller on a prefab of your own? I think I have seen a similar issue before when using standard character controller asset - my character moves to the right slightly even if I am just moving forward.
$$anonymous$$aybe you have 2 rigid bodies stacked on each other causing issues with your character Controller? Revisit your character controller and movement script and see what is causing the issue. $$anonymous$$aybe you have something that is not centered and when you move, you move a corner causing the rotation.
Answer by unit_nick · Sep 07, 2017 at 09:50 AM
Check that your force is being applied at the globalCenterOfMass.
If not then you force will be pushing it off course.
Answer by iramezdev · Sep 27, 2020 at 06:44 PM
I have the same issue, and I can't find any solutions.
Your answer
Follow this Question
Related Questions
How to make a rigidbody move in the direction of finger(x,y,z) 1 Answer
Implementing Counter-Movement 0 Answers
Cube rotates to the left on its own when moving 1 Answer
Child object not moving with parent 3 Answers
Accelerating in Turned Direction 2 Answers