Mouse look needed.

I need a mouse look script with the ability to limit the rotation of the camera and sensitivity.

Thanks. :spin:

You could just use the original MouseLook script and change the limits yourself. I know people who have done this. :slight_smile:

I don’t have a single 2.62 script that works correctly :\

Whoops,

:no: double post. . .

I did a video tutorial on how to create a basic mouse-look script in the BGE: http://www.youtube.com/watch?v=YYlOhtDwElM

19 minutes long?! D: Wow. And does the 2.59 still work in 2.6 versions?

whats kind of mouselook?

this is “mouselook zero”:

requisements: one camera with
sesors => always sensors true
controllers => script

PS: this is a script but…better make a “conversion” to a module


import bge

cont=bge.logic.getCurrentController()

    
own = cont.owner
x, y  = bge.logic.mouse.position
x -= 0.5
y -= 0.5


if not "init" in own:
    own["init"] = 1
    x, y = 0.0, 0.0

#########################################################
#########################################################
    

if abs(x) > 0.01 :  own.applyRotation((0.0, 0.0,  -x), 0)
if abs(y) > 0.01 :  own.applyRotation((-y,  0.0,  0.0),1)



#########################################################
#########################################################

bge.logic.mouse.position = (0.5,0.5)


Here is the above script in a blend

Basic Mouselook 2.62

ml262.blend (323 KB)

Thanks for the help guys! :slight_smile:

easily done

attach the script and the always sensor to the camera, rather than the cube.and change this line

if abs(x) > 0.01 : own.applyRotation((0.0, 0.0, -x), 0)

to this.

if abs(x) > 0.01 : own.parent.applyRotation((0.0, 0.0, -x), 0)

and it will work like you want. Ill make a quick blend

Edit: This will be what you want.

ml262002.blend (326 KB)

pretty cool the last .blend :wink: