• Advertisement

Archived

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

Need Help

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