As of January 2015, this project has been discontinued.
The latest version of the script has been posted on GitHub, and is released under public domain, so feel free to modify and distribute it as you see fit. I currently have no plans to continue development on this project.
- A Mouselook & Movement Script
: March 19th, 2013
Made with [Blender](http://www.blender.org/) 2.66.1 (<i>r55075:55077</i>)
This script is designed to be quick to set up and easy to customize, and offers a Mouselook system and two optional Player movement features.
<i><b>Features included in this script:</b></i>
- Mouselook system
- Two player movement systems (Static and Dynamic)
- Property Hooks - Easily customize how the script works by using Object Properties; No programming required!
- Import, run, and change properties from inside your own script!
Download & GitHub Page:
Updated the main post now.
Updated the files, the movement functions require a keyboard: all keys (true pulse) sensor for now. I removed the requirement of the always sensor, so it only activates the code on direct input.
thanks for this script, it works well, but when I tried to replicate your scene from a scratch the dynamic box does not move correctly. It moves shortly, only when I press forward button or continuously only when mouse is moving in the same time. Please, could you have a look what can be wrong? here is the blend
Just make sure you enable True Pulse for the keyboard sensor. This goes for both the Force and Loc movement (it’s listed in the instructions in those sections of the script)
True Pulse will send a pulse to the controller depending on the frequency (which in this case should be left at default: 0 ). If true pulse isn’t enabled and you press a keyboard key, it just sends the initial positive pulse followed by the negative pulse when you release the key. True pulse mode keeps the positive pulses constantly flowing as long as the sensor is active.
In your file, the reason it moves when you move your mouse is because once you hold the key down and it sends its single pulse to the controller, the mouse sensor which is also connected to that controller sends its own pulses to run the script, which finds that the key is being pressed.
Oh and by the way, you might consider reorienting your camera so it’s facing the forward direction of your player cube, it seems a bit off
I should also add that, unless you’re testing the Mouselook property configuration or planning on changing those properties in game, you don’t need to add properties such as Enable, Cursor, or Invert and leave them all to their default settings. The defaults are defined in the script in case the properties aren’t added to the camera. Just noticed you had added those, not sure if you were testing them out or not
Thanks a lot, it helped, I am very new in BGE, bought the environment tutorial from cgmasters and now making first tests, trying to add movement camera. And yeah after purely copied your scene (except the true pulse) I realized I dont need property config!
Here’s a minor update (v2.1)
I noticed that the camera would somehow start slightly rotating on its local Y axis and causing an awkward tilted view, so I’ve limited that from happening. Download link updated in the original post.
Wooo been trying to find something like this for quite a while now, this has helped me lots! Thanks for the post!
for some reason when i click run script it tells me to look in the console can someone help me ps i am new to blender
You need to be using the Game Engine (logic bricks), not the Run Script button. See the picture in my first post that shows the minimal logic brick setup.
thank you and thanks for the mouselook script this is the only place i found it for the 2.57b
how do i keep the camera from going all the way around so i could see behind me
Wow! Just what iv been waiting for This will work well for doing a fly-through of an environment. Thanks!
@blender dragon: I’m not sure what you’re asking
Your demo file works well, but when I make an own file with your script and move the mouse the camera turns upside down. I used the minimal configuration
Sorry for the delay in response. Could you post your blend file? I might be able to figure out what’s wrong.
Also, did you check the console for errors? Let me know if it says anything about indentation errors by chance.
How do I get the texture/color of the objects I am using to carry over into the game?