Help With Glitching Game

I have been working on a video game and it started acting up in respect to the camera. If you look up or down it will start glitching and then all the sudden it is like you are upside down. I have checked and I don’t think it is collisions gone wrong, but if you guys wouldn’t mind look through and see what you think it is. Here is the link to the file
https://drive.google.com/file/d/0B35OsPAJ46kvaFRoMHMwc3d4VlE/edit?usp=sharing
Thanks

Looks like you need permission to download the file…

My best guesses:

  1. Camera’s clipping values (near/far).

  2. If you’re using the Mousemove script, sometimes if the mouse is not centered before the offset is calculated (which is used to orient the camera), it’ll calculate a huge value and the camera will orient outside the normal range. Hmm, I made a change to the Mousemove script, should go post the fix in the thread.

@Mahalin
I updated the link so it would work, I am using the mousemove script, but I don’t think I changed anything on it and it worked just fine beforehand. I tried changing both the near and far clipping values and it didn’t do anything to help. If someone with more experience in BGE could take a look at it I would be very grateful.
Thanks,

Well, Jacob, I fixed the problem with the camera going crazy! You just need to change that Always sensor connected to the mousemovement (python) to a Mouse sensor, with Movement, and then just change the Python controller to script instead of module and replace it by this script here(Mouse_look.txt):

http://depositfiles.org/files/th9jfs7o4

I think I found whats wrong…You have some axis fighting going on. Lots of stuff has different rotation applied to it. In the mouselook script it has which is attached to the camera.guide cube you have -z set as forward. Looking in this pic you can see that -x is forward on your object.


So its constantly fighting axis.
So I grabbed your camera.guide cube and CTRL-A and applied rotation, to set -y as forward. Then I grabbed everything parented to the cube and not the cube itself and rotated it 180 degrees around to the other side. Like below


Then i changed line 76 in the mouselook script to false. to use the +Y axis for forward and it stopped the glitching. The
file is too big for me to re-upload but hopefully that will help.

Also, the mousescript have no cap limit, so basicly it rotates without limit verticaly and goes from up to down, which is not very realistic

@superflip
Thank you so much, I will make sure to be more careful of getting my local axis lined up right
@postmortem
I will put some rotation constraints on the camera to keep it from being so unrealistic

Thanks guys, this is what I love about this forum, people know what they are talking about and reply quick. Thanks again