- Home /
slide sphere on a slope without rotating
I have a ramp and I move a sphere with arrows. I have unity's gravity and I want the rigid body of sphere to slide when it is stoped at the top of the ramp but without rotating it's body. The problem is if I Freeze rotation on x axis, it won't slide.
You could try using a physics material, like ice, to make the friction basically zero. This would allow a force on the ball, even without torque, to make it freely slide around.
If that doesn't really do it for you, can you explain more? I do not necessarily know what you are trying to do here, like why do you want to freeze the rotation at the top of the ramp?
I don't want the ball to rotate because the ball has a texture of a pac man, if the ball rotates it would be like the pac man will get dizzy. I want the effect you said like the ice effect or let the ball rotate but let the texture stay How can I create ice material?
Apparently, you are under the assumption that a Physics $$anonymous$$aterial replaces a Renderer's material, which is not the cause. P$$anonymous$$s are completely different things and have nothing to do with rendering. They are assigned to a collider to change the way the object reacts to other physics objects.
Check the User $$anonymous$$anual for Physics $$anonymous$$aterials.
Answer by GlatiatorRX · Apr 28, 2016 at 05:07 PM
Ok, Ignore my physics material comment. Physics materials are great when trying to add realism or a slide/stop mechanic, but for general ball motion, lets try using joints.
You will need 2 spheres, both the same size, both with rigid-bodies. Overlay the spheres to the same position, rotation, and so on. And child one of them to the other to look like this in your hierarchy:
Pacman (Stationary)
InvisibleColliderSphere (Rotates)
Once you have those two spheres, set up their components like this.
Make sure all the component variables are the same. The only difference is that you will not need to render the child (collider) sphere, so feel free to remove that component. This is the sphere you want to add all your force to, and it will rotate freely, as your PacMan does now. But, this will make it so the parent object (PacMan) will stay stationary. So PacMan will no longer get dizzy.
If you want me to explain anymore or if you are having trouble, feel free to ask. The components should be easy to read, but are sometimes hard to understand.
Your answer
Follow this Question
Related Questions
Sphere + rigidbody + character controller 1 Answer
Rigidbody Sphere slides around when rotating. 0 Answers
Sphere moves randomly after adding rigidbody! 0 Answers
Movement problem? 0 Answers