Raider's Mouselook

The standard mouselook seems a bit inefficient to me, so I made one.

Setup is dead simple, just have a look at the .blend.

If you parent the camera to an object, it will stay relative to that object.
It can start at any orientation.
It has variable sensitivity and up/down view limiting.
And obviously, you can use it on any game object, not just a camera.

Enjoy, and happy blending! :smiley: I’m open to suggestions and problem reports.

Edit: Drifting issue fixed thanks to Rhys of Files updated.

Two-object variant:

nice job pal

Is it compatible with bling-bling 2.5?

Good job!

I added the left/right limit to it
#Limit x (up/down) angle
own[“ml_angle”][1] = max(min(own[“ml_angle”][1],xlimit),-xlimit) #Limit up/down angle
own[“ml_angle”][0] = max(min(own[“ml_angle”][0],ylimit),-ylimit) #Limit left/right angle

HAHA! THANK YOU SO MUCH!!! THIS IS AWESOME!!! I had actually been trying to do some of the things your script accomplishes with the old mouse look…it was hard! Thanks to your script I can do all that. :smiley:

very elegant way to do this

So how would you make it so that you had, for example, a cube and a camera.

Camera: Rotates up and down.
Cube: Rotates left or right.

@Ninja Goliath:
^^ Thanks.

Yes, although I haven’t tested it.

What’s the left-right angle limit for? :stuck_out_tongue:

Also thanks. =)

You’re very welcome! Here’s a 2-object one.


mouselook_2obj.blend (135 KB)

bump, for the good of the hivemind!

Is there anything else missing from this that people need?

Yes, 2.5 ( bling-bling) compatibility, maybe?!
I’ve tested it, sorry!

Lets say for the first person driver/shooter.

Okay, I tried it too. I think that’s a bug with 2.5, though. I’ve no clue why it behaves like that… I think it is lack of implementation of setMousePosition. There are no Python errors reported.

@Ninja Goliath:

I suppose that makes a lot of sense actually. :U

Very nicely done. Wicked easy to set up. Nice job.

I made a pretty decent simple FPS game using this script. The script makes it work really well because, as far as I know, in the old mouselook scripts, you could never limit the X rotation.

The file I made was probably my first successful FPS game…so its not perfect. The tracking arrows kind of screwed up…don’t know why…but anyway. The game is pretty fun. You just go and shoot the simple AI balls that role at you. When you are in the game try to move and look at your feet. You will see that you wont be able to because of the script. That is good because in a real FPS game you would never be able to look at your feet and therefore the programmer of the game would not have to actually make a full body character.

^ Thats my speel for the day… :stuck_out_tongue:

mouselook.blend (670 KB)

Hope it works, :smiley:

woooww, I was looking for another mouselook script, i hope this works better for me than the las one.

It worked. Nice, =D

So do I, and, you’re welcome. ^^

Looks good, I think I am going to put this in my game Existence. (Which I am still working on! I just have a bug that will not go away…)


So is there a way to make the sensitivity a property instead of in the script? So then you could change the sensitivity lower for through a scope or something.

Nevermind I got it. Thanks for the scipt.
I’m really new to python. (If you couldn’t tell)

Wow, nice job there buddy. Wish I had some use for this…

I used your script but all and it works fine expect for one thing; whenever I go into the game engine and start moving my mouse around camera rotates at a weird angle. May you please help me with this problem.