I figured out a pretty neat way to do stairs, not sure if it’s been thought of before. I did an invisible ramp like most people do, but I make the ramp drop below the stairs when the user is not pressing a key. That way when the user is holding down the button, they can easily walk up the stairs, however when they release, they don’t go sliding down either. I also made the ramp slightly bumpy to simulate the bump of the steps, but not too much or you won’t walk up them.

One problem I am having though, is when I walk down the stairs, my player flies down, as if the are falling/jumping down instead of walking slowly. I’m not too sure how to fix this. Any ideas?

scale the whole model down. blender thinks everything is like ten meters high when it looks small to you. you also have to change speedsfor the characters and things. if you have too much to do just go to the world sub panel in the materials panel and raise the gravity until it is realistic to your model, in fact, that is the easier thing to do, forget what i said first.

Well gravity is already realistic for my scene, it’s just my player wants to run, and when going up that’s fine, as the slope slows the movement, but going downhill makes the character go way too fast. How would I tell my character to go slower only when going down the stairs?

I had to reduce the friction on the ramp because it wasn’t climbing otherwise, but that small friction causes my player to almost slide down the slope when he should only be walking.

i dont have a good answer for you except to make the body a ghost and parent an invisible cube where the feet are with an angled front to push itself up the stairs, therefore eliminating the need for the ramp.


Hmm that’s an interesting idea, I’ll see if that helps.

Unfortunately that didn’t help, it didn’t even climb the stairs at all.

make sure the collision sensitivity is up and the friction is down or post the blend and ill try my best to figure it out

Sorry I couldn’t post a blend because I can’t really reveal too much about what I’m working on.

However, I figured it out finally! This is what I did:Sensor: Keyboard
All Keys (you can specify these depending on your game)

Sensor: Near
Property: stairs (property set in ramp object)
Dist: 0.5
Reset: 0.5

Controller: AND

Actuator: Motion
LinV: Y=0.14 (Add) (Equal to or slightly less than the LinV used for player movement, Axis depends on direction stairs go)
You would actually need one of these for each direction your stairs go (North, East, South, West etc) Using the right number, you should get equal speed going up and down the stairs. You might get sucked in to the stairs if your Near value isn’t low enough. If you are going up and down too fast, increase the friction on the ramp. The LinV value is technically probably dependent on the angle of the ramp.

How does the animation look in relation to the stairs? Ive had a game idea in mind which involves primarily a staircase. But getting the player to actually step on each step and make it look realistic would be difficult…

Similar to how they did it in GTA4, which used a special script system to calculate the walk cycles realtime. Endorphin I think its called.

The animation works pretty good, as I didn’t make the ramp completely flat. I made it slightly bumpy to keep the bump effect of the stairs, but not too much or you lose the ability to climb them. So yes it does keep the bump effect, but it’s not as noticeable as real stairs, and definitely not as realistic as GTA4, that would certainly require a lot of work I’d guess.

morphinapg, here is the file.


STAIRS.blend (193 KB)