- Home /
Rigidbody climbing stairs
Hello, I'm currently developing a First Person Game with my own Rigidbody First Person Controller, and I faced this problem, where player cannot climb the stairs up. I'm controlling the player movement using rigidbody velocity. I know that it is possible to make the player climbing the stairs up by not giving the physics (transform.Translate), but I do not prefer that method, since it can't handle the fast movement (my game is fast paced). I've also seen a video, with the colliders and triggers, and I do not want to do that either.
Answer by Bren0831 · Jul 02, 2017 at 09:06 PM
How about you replace the stairs collider with a sloped collider. That way you can climb the stairs, They still look like stairs and it should fell natural if you add in some camera movement with that.
Answer by Mercbaker · Jul 01, 2017 at 09:53 PM
For player movement up stairs I'd use this > Character Controller
That doesn't really help, because I'm trying to implement climbing stairs in rigidbody.
You should post your code and an image of your gameplay.
If you use rb.velocity on an object it will go up slopes without problems.
If it isn't then you have a unique case and need to post more info.
I can climb the slopes. But i'm talking about the stairs...
How do you expect any help if you don't post sufficient details about your project? I know what stairs are; but, you don't seem to know that in most of all cases, the collision for stairs is a simple slope.
So if that isn't related to YOUR project, then post the specific scenario you have. If the problem is collision, then post an image of your collision mesh and player move code and collider.
You can't expect rigidbody to climb the stairs up, if you use rigidbody movement script. It is not possible due to physics. Rigidbody has real physics, but character controller doesn't. That's why it's possible in character controller. I have found out that unity has made a solution for it by the way. It was adding force manaully when climbing the stairs up (y velocity). It can be found in rigidbody fps controller script in unity's standard assets.
Your answer
Follow this Question
Related Questions
Keep Horizontal Momentum after Jump 2 Answers
RigidBody.MovePosition seems jerky in movement 0 Answers
stop vehicle from moving through walls 1 Answer
Rigidbody keeps sliding 0 Answers