Stairs move and down

Hi girls!
I found a stairs playground by @splash27 … works pretty good. (arrows or wasd keys)

It uses handy FPS (first person shooter) collision system… built-into BJS and freeCam.

If you need third-person view instead, you would make test boxPlayer (any mesh)… and set its checkCollisions true. Then move the boxPlayer up/down the stairs… via boxPlayer.moveWithCollisions() operations.

anymesh.moveWithCollisions() is VERY different… and sometimes challenging. :wink:

Hint. For third person view (perhaps with follow-cam)… maybe make boxPlayer.ellipsoid be small on X/Z, but tall on Y. If boxPlayer.ellipsoid is too fat… player could “slide down stairs”… depending on z-depth/tread-depth of each stair-step.

Generally speaking, turn off ALL collision-stuff upon (any) camera… for 3rd person view. boxPlayer gets all the collision stuff… but not .applyGravity. When using boxPlayer.moveWithCollisions() to move mesh on stairs… you must code your own gravity effects. (not very difficult)

Too much to explain at this point, Rex. :slight_smile: I just wanted to show you a non-moveWithCollisions() playground (first-person) made by a forum friend. Be well. Look for others to comment, and maybe a friendly forum helper will make a third person PG version for us… and show us. :wink:

4 Likes