- Home /
cube rotating for no reason, how can I stop this?,Object Rotating for no reason, how do I stop it?
So, I am very new to Unity. I have a "Player" which is a cube moving across a plain with 0 friction. The cube is being moved by a forward force. For some strange reason, the cube will have a very slight rotational velocity as it is moving forward, I would just disable rotation but I want the cube to display physics as it collides with objects. I have tried only enabling rotation once a collision with an object has occurred but as the collision has already happened the physics reaction is not correct. Does anybody know how to remove this slight rotation that is happening to this cube?
Is the ground also frictionless? If not, the cube will slightly tip, as you add force to it.
@Llama_w_2Ls, Sorry, was no specific enough it's rotating slightly on the x axis not the y. And yes the ground is frictionless
What method do you use to move the object?
@pauldarius98 Rb.addforce(0, 0, forwardforce);
Rb is my variable for the cubes RigidBody. Forward force is a float set to 1000 currently.
And your physics material properties? Is the friction set to 0 for static and dynamic? or just for dynamic
Not at my computer right now so can't check but I'm pretty certain both are 0
If there are no solutions, use rigidbody 'Freeze rotation' :)
Answer by pauldarius98 · Mar 01, 2021 at 02:08 PM
Ok, so after reading the comments i think that the problem could be that either:
Static Friction was not set to 0 (for the material on the moving obj)
Friction Combine was not set to Minimum (for the material on the moving obj)
If that is not the case, then please provide further details on the object material, ground material and other factors that could influence the rotation of the object
I will have a look later on because I'm not entirely sure what friction combine is so that may be the cause, thankyou. However even if friction on anything isn't set to 0, my issue is not the cube toppling over but instead twisting on its base, the base of the cube never loses contact from the floor it is just slightly rotating to the left, if I am only applying a force directly forward, then there shouldn't be any other factors that could cause this cube to turn to the left
Answer by Okmy · Jun 03, 2021 at 09:09 PM
@PaulDarius98 Thank you mate, I was kind of stuck in my development for the same reason, my cube that has a forward force was moving to the right and rotating to the "left" on his own. I just set the Friction Combine to minimum and it worked.
Your answer
Follow this Question
Related Questions
Cube material is briefly blue 1 Answer
Make a Cube Move, through rotation! 1 Answer
Putting text on a 3D object? 3 Answers