- Home /
How can I make my rigidbody latch onto a wall? [C#]
I have my main player (A sphere) that can roll left and right using my controls. I want to add a wall that the ball can roll up, with out falling off, or rolling down. BUT, I want the player to be able to fully control the ball still. I threw together a really simple demonstration of what I'm trying to achieve. Thanks everyone!
Basically, to explain in simpler terms, I want the ball to be able to roll up a wall, without falling. BUT, I want the player to still have full control of the ball, rolling it up and down the hill.
Answer by AyAMrau · Jun 27, 2014 at 06:09 PM
Depending on how much of the rigidbody behaviour you want to keep while one the wall, you could either turn off gravity or make it entirely kinematic:
rigidbody.useGravity = false;
rigidbody.isKinematic = true;
I already tried the gravity thing. It really just acted at a speed boost more than anything. And I don't think kinematic will work, because I still need the rigidbody to control the movement of the ball. Thanks though!
Your answer
Follow this Question
Related Questions
the code work bat is not push the ball but with speed of the character ? 2 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Orbit problem in 5.0 unity 1 Answer