Hi all, I have a standard cube with a rigid body attached and I cannot seem to stop it moving when its resting. It always slides slightly so that if I leave the game alone for a while it will move all the way over to the other side of the screen.
I have tried playing with the friction values etc with no luck. The platform the cube is on is completely flat.
If you download the FPS Rigid Body example it comes with a demo of the Rigid bodys useage, and in the demo it automatically slides and its kinda old. Help
Maybe, but I have the exact same problem as the OP. In fact I have temporarily abandoned the game idea because of it. No mater what I did to the moving object and the resting surfaces the moving object would either wobble off or slide off. I tried huge mass, materials I even tried the turning off kinematic which worked best BUT the logic to try and decide when to do that made it temperamental.
So I too would like to know how best to achieve this. I have a great game just sat in a directory waiting for the answer.
I’m having the same trouble. This thread was started in 2009. It’s 2013 now and still no answer to this widespread problem? A lot of projects have been abandoned for this rigidbody sliding and bouncing defect.
Yes I know this is a bit of a necro, but hey, someone resurrected this from 4 years in the grave so…
I ran into this seemingly out of no where, and did a bit of searching then had a “DOH!” moment. Make sure that your rigid body isn’t a Child of your camera, and the camera set to follow the ridigbody. This is what happened to me. I was organizing all my Levels “standard” objects into one game object, and accidentally made the character a child of the camera I setup to follow it. This will constantly “slide” your character based on the last movement speed.
Hi all, I know this is pretty old but, for anyone like me that may end up here, there is another thing you can try that I didn’t find in the posts above.
So, if you are still here and nothing worked, check if you have component attached to your object. If you have - disable it and try to run the game. If the issue disappears you should check and change the settings of your animations controller and/or animations!
I had a similar problem with RigidBody objects. In my case, the problem was that the surface where the objects were resting had a MeshCollider, which for some reason was producing a slight sliding of the objects. Changing the collider of the surface to a simple BoxCollider fixed the problem.
I am not sure about the reason for this, but my guess is that the MeshCollider was overloading the physics engine with too many precise calculations, resulting in the sliding on the objects.
I know this is super late however i ran into this problem as well and could not find the answer because none of the above worked for me so i keep searching and find an idea on how to fix this problem. and with that in mind this is what i came up with to fix it.
Hope it helps.
I ran into this issue building the space shooter tutorial. I increased the drag to 10 and the speed to 200 and that solved my issue - thanks GGlio/ others who provided the same advice.
I think i have finally solved this. I was having the same issue and racking my brain about it. Turns out it was way too simpler. are you using the default 2d asset platforms? If so, the default 2d asset platforms have an attached collider set to be slippery, just turn that off.
I’d like to add my case just in case another developer has a similar problem like me:
If you have a gameObject with a spherical collider (e.g. with frozen x- and y- axes but the y axis remains unconstrained) and you got a 2d sprite on it which - like in my game project - is facing itself to the camera (via script), then your GO will slide after any movement IF you have no angular drag on the rigidbody component! Setting it to 1 eliminated that problem.
Had a problem like this in my 2D project. Figured I’d share what fixed my problem. Turns out if you set the rotation of an object with a script, and it collides with something, it can cause a velocity from the angular force. The fix is to enable the “Freeze Rotation” “Z” constraint on the Rigidbody2D with the rotation script.