# Camera Problem

4 replies to this topic

### #1 Knuxfan24

Knuxfan24

GMC Member

• New Member
• 3 posts
• Version:GM8

Posted 10 May 2012 - 09:57 PM

Hello everyone. I've been having a few issues with programming a first person mouselook camera in GM8. I followed some instructions from this thread (Namely the 7th post). For the most part the programming works, there's just one issue. Moving forward causes the camera to show the opposite direction than the one you're moving in, stopping causes the camera to flip back to how it should be.

Does anyone have any idea how to fix this issue? It seems to be linked to this line of code in some way:

• 0

### #2 BattleRifle BR55

BattleRifle BR55

Moo

• GMC Member
• 8249 posts
• Version:GM7

Posted 11 May 2012 - 12:58 AM

In zt, subtract tan.
• 0

### #3 Gamer3D

Gamer3D

Human* me = this;

• GMC Member
• 1590 posts
• Version:GM8.1

Posted 11 May 2012 - 02:22 AM

Change to end step.

Here's what I think is currently happening:
• Begin Step or Step: You calculate xt, yt, and zt.
• Between Step and End Step: Object moves according to hspeed and vspeed. In other words, x and y change.
• Draw (Comes after end step): You set the camera based on x, y, z, xt, yt, and zt.

• 0

### #4 Knuxfan24

Knuxfan24

GMC Member

• New Member
• 3 posts
• Version:GM8

Posted 11 May 2012 - 06:14 AM

Change to end step.

Here's what I think is currently happening:

• Begin Step or Step: You calculate xt, yt, and zt.
• Between Step and End Step: Object moves according to hspeed and vspeed. In other words, x and y change.
• Draw (Comes after end step): You set the camera based on x, y, z, xt, yt, and zt.

Yes that was the solution! Thank you so much for your help.
• 0

### #5 Knuxfan24

Knuxfan24

GMC Member

• New Member
• 3 posts
• Version:GM8

Posted 13 May 2012 - 03:15 PM

& now there's another issue. It broke the shooting code from the tutorial.
• 0

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users