- Home /
climbing the hill?
I'm using Translate function to control a Rigibody and making it run along on a mesh, but the Rigibody always roll to upside down when climbing up a big slope. How can I make it climb over the slopes with its downside moving closely along the slope ?
Can't you lock the rotation in a rigid body? I'm almost positive you can in Unity 3.3.
Answer by Aurelio Provedo · Apr 14, 2011 at 07:16 AM
I suppose it would be a matter of how you apply the force.
Think of a similar example in real life. If you wanted to push a standing barrel on a flat horizontal floor without it falling, you'd have to push it carefully. You'd want to apply some downwards force and/or push closer to the floor. If you put your hands on the top of the barrel and then pushed forwards, the bottom part would stick to the floor because of friction, and the barrel would fall for sure.
Make your force point slightly towards the ground or/and use RigidBody.AddForceAtPosition()
But more importantly, always lean back and think: would this actually happen in real life? Because most of the times, physics engines aren't wrong...
Your answer
Follow this Question
Related Questions
How to detect ground slope angles in 3d? 1 Answer
Dealing with 2D movement and collisions! 1 Answer
Problem sliding down hills (WITH VIDEO) 1 Answer
how to use random.range to switch switch facing of a rigidbody between z+,- and x+,- 2 Answers
Elevator that parents player to itself causes jittery motion. 1 Answer