Staircase angles and dimensions
At the moment our stair climbing blendspace spans from 20 to 50 degrees. That means anything in between should work fine.
Height of stair step should not exceed 20 cm.
Spiral staircase is possible.
There should also be at least 1 m long horizontal platform on both ends of the staircase.
When creating stairs you need to follow these rules to make animation work properly.
There needs to be two physic collision primitives defined as you can see on picture below:
- Full mesh planes or primitives for correct foot alignment.
- Slope plane to define slope.
For spiral staircases, slope plane is of course not plane, but some spiral mesh. Important is the mesh has no thickness, it's just one-sided polygon(s).
Each physics meshes needs to have special physics material in order one is able to assign different surfaces on them in Sandbox.
- Full mesh collision needs to have stairs_xxx surface type assigned. XXX is selected according material of stairs for example wooden stairs will have stairs_wood assigned.
- Plane needs to have slope surface type assigned.
To test if stairs works properly you should run game mode step on stairs and turn mannequin debug on. Then check two things shows up when walking on stairs.
- stair tag is active
- slope is greter than zero
See following picture and red and black bordered areas.
- NPC is not able to climb up the stairs – staircase is too steep
- NPC's animation while walking climbing the stairs looks weird – stairs proxies are not properly configured
- Player starts sliding down the stairs when he stops in the middle of the staircase – adjust slope plane position so it slightly protrudes (see image bellow)