Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

phshort2001

Need Help

This topic is 5957 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

Hi guys, im workin on a 3d first person shooter and was wondering how you make it so when you look up with the mouse and press forward you dont go straight up in the air,you stay on the ground and move forward. I have tried a few ways to implement this but I cant get it.Thanx in advance

Share this post


Link to post
Share on other sites
Advertisement
In your code to move the camera, just don''t calculate the Y position... And explicitly change it when going up stairs or anywhere else you''d like the camera to move upwards.

Henrym

Share this post


Link to post
Share on other sites
I have separate directions for "heading" and "looking". Basically, I have a basis (three orthogonal vectors) that define which way I would walk if I pressed the arrows. Then I have three Euler angles that define which way I look relative to whatever way I''m headed.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!