game script not working?

Hello,

i’ve been working an a game lately but came across a error i could not sovle.

if dead.isPositive():
	own.death = 1
	print own.death

if (own.death == 0):
	GameLogic.addActiveActuator(Move, True)
	print own.death

if (own.death == 1):
	if resume.isPositive():
		own.death = 0

Now I have a property thats already set to 1 when the game starts, so when i start the game my cube doesnt move. (as it should).
when i press resume the cube can move again like it should.
BUT, when i press the dead button my cube still moves.

so i printed out when the variable is what.
-when the game starts death=1 (good)
-when pressed resume death=0 (good)
-when pressed dead death=1 (good, but my cube still moves but i clearly said that if death=1 it should not move).

anyone see the error I made or a way araound this?

btw, is ths the correct support forum about python scripts?

have you checked if you are using force or dloc in the motion actuator?.. coz if you are using force… that might cause it to take a while before it comes to rest.

no, i use Dloc, but when i have pushed the dead butten it still apply’s all the movement i make. like nothing happend. i can still drive araound in every way i want

if dead.isPositive():
    own.death = 1
    print own.death

if (own.death == 0):
    GameLogic.addActiveActuator(Move, True)
    print own.death

if (own.death == 1):
    GameLogic.addActiveActuator(Move, False)
    if resume.isPositive():
        own.death = 0

Try this out… i.e, disabling the actuator when the death thing is 1
btw … another way of doing this would be to change the state to an empty state… i.e no inputs not movements nothing… the object will just sit there… :slight_smile:

a thanks very much, this did the trick (kinda stupid for me to oversee this)