Jump to content
  • Advertisement
Sign in to follow this  
ddamicoAVI

Walking up stairs XNA

This topic is 3758 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I created a basic stair case model and loaded it into my XNA game. I have a first person camera that needs to "climb" this stair case model. What is the best way to go about something like this? I tried to create bounding boxes around each step and then check if the bounding box intersected a bounding box that I created around the base of the camera. It sort of works going up the stairs, but coming down... not so much. Suggestions? Thanks, Dave [Edited by - ddamicoAVI on March 7, 2008 3:58:41 PM]

Share this post


Link to post
Share on other sites
Advertisement
Easiest way I can think of (not sure if its the best)... is to have a function called "GetHeight()" on your ground plane (which includes the stairs). Then have the camera +x above the GetHeight() value. So if you hit the stairs, your camera will jump up on each step up.... this method will also work on walking on a not flat terrain too!

Jeff.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!