Public Group

#### Archived

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

# First Person Camera problem

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

## 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 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)

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
5. 5

• 9
• 12
• 16
• 26
• 10
• ### Forum Statistics

• Total Topics
633769
• Total Posts
3013759
×