cont = GameLogic.getCurrentController()
own = cont.owner
Space = cont.sensors[“Space”]
PR = own[“C”]
A = (PR + 1)
own[“C”] = A
I have a cube with a Space sensor attached to that python script.
The cube has a property called C. Every time I press space, it adds 1 to C.
The script works just like I want it to, but the console says this:
Python script error from controller “cont#CONTR#1”
Traceback (Most recent call last):
File"Test.py", line 20, in <module>
NameError: name ‘A’ is not defined
Help a bad coder out please