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 GB.org. Files updated.
http://www.gameblender.org/download/file.php?id=1998

Two-object variant:
http://www.gameblender.org/download/file.php?id=1999

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.

@OTO:
Yes, although I haven’t tested it.

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

@Nikolay:
Also thanks. =)

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

Attachments

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!
Bye

Lets say for the first person driver/shooter.

@OTO:
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:
Oh.

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:
Sunjay03

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

@Sunjay:
It worked. Nice, =D

@Leonnn:
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…)

Thanks!

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.