MouseMove - FPS Mouselook & Movement Script

Cool script, but how can I start and stop the script ingame?

The simple way is to add a Boolean property to the object using the mouselook script, and name it ā€œenableā€. True = Script is on; False = Script is off.

It do not not work :confused:


Thatā€™s strange. I just tested it out in a new blend file, and it worked as expected. Iā€™m not sure what the problem is for you.

Hi, i just tested it, and im only able to move left or right, but am unable to lower or raise my aimā€¦ could you help me out, please?

Awesome script, just tested it and everything works perfectly

BUT after jumping you canā€™t change direction or speed of your movement.
if I understood right it is supposed to be like this?
is there any way to let you control your flying after jumping?

ps. Iā€™m not familiar with python, but any advice will be appreciated!
thanks for the great script anyway!

@gniorg: Could you post a .blend file with the problem?

@jarkko: The movement is meant to be more realistic like that, yes. You can add a boolean property named ā€œDFLYā€ to the mouselook object, and then set it to True. This enables fly mode, which mean you can jump and move without touching the ground. Iā€™m not sure if thatā€™s what you want though.

no, I mean after you jump (in dynamic movement mode, without flying mode), you canā€™t control yourself until you hit the ground again, In most most games you can change your way or slower your speed in the air. I know itā€™s not realistic but thatā€™s what I need, Thanks

Ah, I see. Iā€™m working on a new update for the script, so Iā€™ll add this to my to-do list for the movement system. For now, you could perhaps just set up your own movement system out of logic bricks, using servo motion actuators. Theyā€™re good for limiting velocity to prevent the object from sliding.

If you could make this script for 2.64 and make it so I can use the Character physics instead of Dynamic, I would love you forever

The Mouselook function itself should work fine in 2.64. The Character physics type uses location instead of dynamic motion (force and velocity), so I will need to write up some new code for that. It might be a while, but Iā€™ll add it to my todo list.

In the mean time, you could probably make your own movement system with logic bricks, using loc values to move the player around.

Yes but that would mean I would have to lose my ability to start and stop the character when I absolutely need to, and I do a LOT of the time in my game ._.

Riyuzakisan this is a great tool thank you for all the hard work you put in to this one. i was wondering how would you go about adding the ability to lean when crouched or standing and rolling when prone?

Thanks. That sounds like something that would be on a rigged fps character, with an armature and animations. The physical bounds of the player also need to be scaled down when crouching, to fit under smaller spaces. Iā€™m not sure how that could be done by just the script.

As a side note, the movement systems in this script are just meant for quickly being able to demo a scene. Iā€™d imagine an actual first person shooter game would need to invent its own more complex movement system, with features like those that you mentioned.

Hi, i seem to be missing something, the script works like a charm, if only for the fact that sprinting and crouching doesnt work, do i need the collision and ray sensors for that? and that leads to my next question:
Ground Detection: For detecting ground collision for proper jumping mechanics, a Collision and Ray sensor can be added to the Dynamic object and connected to the Python controller on the Mouselook object.
how can i connect a sensor of one object to a controller that resides on another object? or do i just make a controller with mouselook script on the ā€œcharacterā€ object aswell?

Iā€™ll address your second question first, about the ground detection. Youā€™ll need to select the player object first (the one with the collision and ray sensors), and then Shift + Select the Camera (mouselook object). Selecting them in the opposite order would work just the same. The Logic Editor should now show the logic bricks from both objects, so you can cross-connect them.

I started out from scratch to set up the mouselook script, and found that without the collision and ray sensors, sprinting and slow-walking (ctrl) donā€™t work for some reason. I donā€™t remember if this was something I did on purpose or not, but Iā€™ll keep it in mind for the next update. In this version, youā€™ll need the collision and ray sensors for sprinting and slow walking to work. I also noticed that sprinting doesnā€™t offer much of a speed boost (also something Iā€™ll keep in mind).

Iā€™ll also rename ā€œcrouchā€ to just ā€œwalkā€ or ā€œsneakā€ in the documentation in the next update - itā€™s a bit deceptive since the player canā€™t actually crouch down lower :wink:

thanks Riyuzakisan i will attempt to animate a lean and see if i can bind it to a key, thinking pulse should do the trick.

Is that possible to add a hand or something, what could pick up a object from ground? Like in Half-life?

Itā€™s possible, but itā€™s something youā€™ll have to do on your own :wink:
Iā€™m only distributing a script here.

i need some help with this, i thought i did everything the way you did, but my characters movement is somehow messed up. it goes like this
(A=Backwards, D=forwards, W=Left, and S= Right.) any idea as to how to fix that? thanks a lot