Successfully ported MouseLook 2.49 to 2.5


Here you go, it’s done. My attempt to port MouseLook 2.49 from for 2.53 Beta was hopefully successfull. I updated the attached file below and suggest to put it into Game Engine Resources if now further issues appear.

Maximum angle restrictions are -85 and 85 degrees up down (which is the same as in the 249 template). You can change the limits in between via property or you can completely remove the property to have no limits at all. The angle in the attached file is currently set on 20 degrees up/down. Btw. the issue with the obj[“Cap”] == True: was resolved with “is not None”.

Have fun :slight_smile:


MouseLook_25.blend (328 KB)

I’m no python guru (in fact I know almost no python), but I remember trying to fix this problem yesterday.

Instead of

if obj.get('Cap') == True

Try using

if obj.['Cap'] == True

Then it just has a problem with main()

Hope this helped.

Doesn’t work, just prints a syntax error :frowning:

Works fine… no error…

if obj[‘Cap’] == true
That might do it.

Its not working 100% correctly yet, because the cap limits don’t work.

I have now changed in the below file the angle calculation in the code since the “Mathutils” don’t seem to work anymore. Now its limited to fixed -80 degree downwards and +80 degree upwards.

Unfortunately the angle calculation always displays angle between 0 and 180 degrees, whereas I would need angles between 0 and 360 degrees. If I change it to -90 and +90 (which is what is required for the holy grail) the mouselook will not be restricted. You don’t want to have that on a First Person Shooter Template, I’m afraid…Of course theres always the possibility to accidentally have fucked up something.

Edit2: ok forget the paragraph above, i have just found out that the working principle is correct, the Mouselook 2.49 was also not able to make a full 90° up and down. It was limited at 85 degrees. In that case i’ll try to clean up the below template with making possible with variable angles.
Still it is annoying that the code: obj.get[“Cap”] == True or obj[“Cap”] == True won’t work if you use any Integer or Float value instead. But as I have written before, it works for the obj[“Adjust”] which is used some lines prior… this is ridiculous!

@mokazon: already tried that. Doesn’t work.

edit: old testtemplate removed

Edit: issues have been resolved, see first post for updated file.

Oops, that period wasn’t supposed to be between obj and [‘Cap’] :o