Help with python tutorial!

[INDENT]Hello everyone,

i had followed a tutorial on python(link will be at the bottom of the post) which was about programming using pythons on the bge.I finished the tutorial but still didnt get the results i was supposed to get.can some one please help me identify and fixe this problem:confused: .

instead of screenshots here is the blend file.

and here is the link to the tutorial:


You need to fix your links, they don’t lead to the images that you are reffering to.

There is a problem in your python script. Write the code exactly as I write it in the tutorial, including spaces. Your if statements should look exactly like this: (note the spaces between = and -speed and -rspeed)

To learn more about python in general you should go through the 3rd prerequisite link, and read “A Byte of Python”.

if forward.isPositive():
    walk = speed
if backward.isPositive():
    walk = -speed
if turnleft.isPositive():
    turn = rspeed
if turnright.isPositive():
    turn = -rspeed

You should ask questions like theese in the Game Engine forum, where I can see them and answer them.

Also, there are no = signs after getSensor. It’s just cont.getSensor(“sensorname”). And yes, you need cont everytime before .getSensor().

You really rushed it.

Hey Jam! Heres what I made with that tut. And it should work fine. Just look at my python script and make sure it matches exactly.

social:thank you for your help indeed,yes there was a problem with the link so instead of screenshots i decided to upload the file so anyone who can help me to identify the problem may do so.

p.s. i was wondering where i should post this up,so my mistake,next time ill post it where you told me to do so.

master-noob:waz up mayn,thanks for the link to the tut,it really helped me out.and the .blend file u gave me now is great,you have to teach me how to do more of this mayn!LOL!thank you for all the help.can you try and identify my problem please.

…??? Are you kidding. I already did that. You didn’t read the code right on the tutorial page.

Here is a mini tutorial on figuring out what you did wrong:

1 - Go to the tutorial page
2 - Compare your script with the script on the tutorial page
3 - Make your script look exactly like the script on the tutorial page

thats what im doing now.

:smiley: I fixed it,the problem was i did not type in cont. in front of the directions in the sensors sections.

:smiley: special thanks to the contributers of this thread!:smiley: