Game Engine Hysteria

I am trying to fix 2 “bugs” (more like fails that I made) in my game. It has been annoying me to the point of hysteria. If you start the game, look up (it follows mouse movement), then hit W (forward), you will start to “fly”, meaning that you will defy gravity, go into the sky and not come down. How can I prevent/fix this?
The second bug is a walk through walls glitch. When you run into a wall head-on, nothing unusual happens. However, when you stand beside a wall and walk left or right (with A or D), you can warp through it. Why is this, and how is it fixed?

Can you give step-by-step instructions on how to fix this?

A) I think you let the object teleport (Loc) rather than move (force/velocity) with the Physics engine. This explains the will problem with the walls (which is ask quite a lot.)

B) I think you use local motion. This is not incorrect as long as you want to move into the direction the camera is facing. Better separate viewing from motion.

Thanks for the replies. However, I am brain dead in the ways of Blender. I don’t really understand what you were trying to get across, however, I understand that dLocation is bad. SolarLune, how did you get your script to work? I thought I had all the settings exactly duplicated in my test blend, but it won’t work. Can you give step-by-step instructions?

dLocation is bad because you’re basically teleporting your character to another position, so he can phase into / through objects. It’s like, instead of moving an object forward, you’re simply placing him at his new position.

As for your question, did you add a Python controller and attach the script to your object? Is the object dynamic? It requires the same setup with the camera object named “GameCam” parented to the player object. Have you tried saving yourself the trouble and just appending the camera and player object from my blend? Be sure to press Control + 0 with the appended camera selected to set it as the main camera.

SolarLune, I did add a Python controller after copy and pasting the script into the editor, the object is dynamic, I parented the object and camera so that both move when the object moves. I believe that is the same as yours. I cannot simply append your objects because I have a custom object that must be in view of the camera, a property that your object does not have.

You could:

  1. Simply try appending the objects to ensure they work in your blend file. If it works, you could just then reparent the object in front of your camera to be in front of the appended one.

  2. Ensure that the camera is named as I mentioned (the script looks for the camera object to be named “GameCam”).

  3. Post your blend file to help us see what the issue could be.

  4. Check the console for errors, and post them if you find them. (You can enable the console via the Window menu at the top of Blender if you’re on Windows, or otherwise starting Blender from a terminal if you’re on another OS.)