   Problem with Mouse Movement
  Hello, I am fairly new to Direct X and C# game programming and I am currently working on making my first small game that requires tracking mouse movements.The problem I am having is that with my if statements, it is only performing the first one. If I comment the if statement out above it the next one works fine in my 3D world. Basically I am trying to make it so the Camera's LookAt target is updated as I move the mouse (much like it does in several FPS).Here is the function I wrote that is being called at the top of my render function;public void readMouseInput()   {  Vector3 Move;  if (frm.mice.CurrentMouseState.X > 0)  { Move = frm.CameraLookAt; Move.X -= 1f; Move = new Vector3(Move.X, Move.Y, Move.Z); frm.CameraLookAt = Move;  }  if (frm.mice.CurrentMouseState.X < 0)  { Move = frm.CameraLookAt; Move.X += 1f; Move = new Vector3(Move.X, Move.Y, Move.Z); frm.CameraLookAt = Move;  }  if (frm.mice.CurrentMouseState.Y > 0)  { Move = frm.CameraLookAt; Move.Y -= 1f; Move = new Vector3(Move.X, Move.Y, Move.Z); frm.CameraLookAt = Move;  }  if (frm.mice.CurrentMouseState.Y < 0)  { Move = frm.CameraLookAt; Move.Y += 1f; Move = new Vector3(Move.X, Move.Y, Move.Z); frm.CameraLookAt = Move;  }   }This is the override function for the mouseMove which is having the same problem as above; protected override void OnMouseMove(MouseEventArgs e)   {  //if (0 != (e.X | e.Y))  //{ if (e.X >= 1)cameraLookAt.X -= 1f; if (e.X <= -1)cameraLookAt.X += 1f; if (e.Y >= 1)cameraLookAt.Y += 1f; if (e.Y <= -1)cameraLookAt.Y -= 1f;  //}  base.OnMouseMove(e);   }I believe the problem has something to do with the fact that the rendered calls the function so fast it only has time to perform the first If statements...but that makes me think there would be a memory leak and stack overflow which there aren't. Any suggestions would be great thank you ahead of time.[edit: code tags are your friend -SiCrane]   
  Did you step through your code using a debugger already? It's very unlikely that the rendering process is interrupting your code - you've probably made a mistake somewhere that's interfering with this code, or the functions you're calling aren't doing what you expect them to do, so it seems as if your code isn't executed.   ;  Hello, Thats what I thought aswell....I remember my college prof always telling us "the Computer is never wrong" but I have gone over the logic multiple times and changed it and what not and I do not believe that is the problem. I have also setup breakpoints and stepped through the project and it all works fine in theory but when it comes to execution time it is just skipping over the other blocks.Anyways you for your input its greatly appreciated.   ;  You may have stepped-through with a debugger, but did you evaluate the variables as you stepped-through to see if something is changing that you didn't expect?  I'm not a C coder, but nothing is glaring at me as being wrong with your code.  Sounds a lot like the other if statements are being optimized-out for some reason.Step-through and evaluate each var after EACH step.  There's barely any code there so it's no great mission.  Let us know what you discover, if anything.   ;  Thank you everyone for your reply. Yes I did use the debugger to step through and it appeared everything was working correctly through the variable properties and what not so I too believe that it is skipping over the rest of the IF statement blocks....for what reason I do not know. However, I am no longer using these functions I was somewhat told how to do it in another forum and the function now looks like this;private MouseState previousMouseState;   public void readMouseInput3()   {  MouseState currentMouseState = frm.mice.CurrentMouseState;  float pitch = currentMouseState.Y - previousMouseState.Y;  float yaw = currentMouseState.X - previousMouseState.X;  float sensitivity = 0.018f;  Vector3 temp;  temp = frm.CameraLookAt;  if (currentMouseState.X != previousMouseState.X)  { yaw += currentMouseState.X * sensitivity;  }  if (currentMouseState.Y != previousMouseState.Y)  { pitch += currentMouseState.Y * sensitivity;  }  temp.X = (float)( Math.Cos(yaw) * Math.Cos(pitch));  temp.Y = (float)(Math.Sin(pitch));  temp.Z = (float)(Math.Sin(yaw) * Math.Cos(pitch));  frm.CameraLookAt = new Vector3(temp.X, temp.Y, temp.Z);  cam.updateCamera();   }I am currently trying to work out the last kink with this FPS camera function. The last problem I am having is it appears that the scene is adjusted on the mouse movement but the next frame kicks it back to where it starts so I am sure I am missing some call to a function somewhere that is redirecting the camera.Thank you all again for your help and suggestions.   