Archived

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

First Person Camera problem

This topic is 5043 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 all, I''ve just got a camera working for my game. The camera i''m using decides the way you move by moving you in the dir of "dir", when dir = Lookatpoint - Position. My problem is that i want to be able to look any where, but only move on a flat plane (instead of moving in the air when I look into the air). I know i have to add something to Lookatpoint - Position, but i don''t know what. Could someone help me? thanks.

Share this post


Link to post
Share on other sites
zero the y component of the dir and move by that. if you want, get the length before, zero y, normalize, and remultiply by the length to keep the velocity you would normally get (you probably want to do this so you don''t move slowly when you look up).

of course, the obvious solution is to just make movement independant. ie, move x by cos(yaw) * speed, y by sin(yaw * speed. this way you can look in a different direction than you are traveling (strafing usually)

Share this post


Link to post
Share on other sites