i am using a mouselook script but when i try to run the script, it keeps saying one of my lines of code is wrong:ba:…(dont get me wrong, im still a newbie at python) the script is:
Up.setDRot = ( rotUp, 0.0, 0.0, True)
it is made almost exactly like all my other codes like the Left, Right, and Down.setDRot but it just keeps saying its an invalid syntax!
o yeah, the left, right, down.setDRot scripts look like this:
Left.setDRot = ( rotLeft, 0.0, 0.0, False)
Right.setDRot = ( rotRight, 0.0, 0.0, False)
and:
Down.setDRot = ( rotDown, 0.0, 0.0, True)
but all those r right
HELP ME PLEEEEEEEZ!!! i would appreciate it ALOT!!!
Can you show us the whole code ?
Or at least the lines before and after the error ?
Maybe you forgot to close a “)” at the end of the line above or something like that (indent,etc…)
I have tested it to the point of up to “Up.setDRot( 0.0, 0.0, rotUp, True)” and everything before that is right ( i dont know about after it, i havent gotten past the problem yet.
Mmmmm
I dont have the necessary Game Engine python modules to test it.
Anyway there are a lot of typo errors here…
Here: def mouseMove ():
There: mouse = controller.getSensor(“Mouse”)
There: Down.setDRot( 0.0, 0.0, rotDown, True)
Where can i find those modules ?
EDIT ok found them…
gameWidth and gameHeight are functions… You should add () at the end of lines 8 &9 if you want to get a value returned
k ill try that…
srry about the typos n e ways…
i tried the thing about putting a “()” by lines 8&9 and it still sais ther is a invalid syntax in line 33.
I put in bold what I’ve changed.
In addition to what Gwenouille said, just remember that Python is case-sensitive (left and Left are two different variables)
By the way, you don’t need so much actuators to do what you wanna do: comment the last two lines and you’ll see that it still works fine! You could even just use one actuator…
So, here’s my file: link
I put two examples: one with a cube (first scene), one with a camera (second scene).
Both of them run well on my computer (Blender 2.44 or 2.45).
(I didn’t want to spend time adjusting the camera’s movement, so the shifting isn’t well at all, but still it runs)
Your reply isn’t detailed enough to find what causes this issue, so could you please post your file somewhere if my file doesn’t help you?