Hey guys, back with another problem : i’ve animated a door opening, i’ve got a sensor listening for mouse input, linked to a python script which in turn is linked to an IPO actuator.I use a bool property to check if the door is open or closed.
What i want to have happen :
1 when i click, the script checks if the door is open
2 if it’s not the actuator plays frames 1 through 30 and then sets the property to tell me that it’s open
3 if the door is open the actuator plays frames 30 through 1 and sets the property to tell me that the door is closed
THE PROBLEM : it seems that i can’t change the values i entered in the logic block using the script, if i enter in the logick bloc start 1 and end 30 only the open animation plays, if i enter start 30 and end 1 only the close animation plays, my script looks like this :
if doorState.data == 0 :
# the door is closed
# play open animation
openDoor.setStart(1)
openDoor.setEnd(30)
GameLogic.addActiveActuator(openDoor, 1)
doorState.setData(1) # door has been opened
else :
# the door is open
# play close animation
openDoor.setStart(30)
openDoor.setEnd(1)
GameLogic.addActiveActuator(openDoor, 1)
doorState.setData(0) #door has been closed
is there a bug with the actuator that won’t allow me to change it’s data ?
my solutions as i see them would be :
either use two actuators for playing back and forth the animation
either animate the door closing and opening whithin the same ipo
but these are both undesirable since the actuator should be able to do what i’m trying to do with it, can you guys help pls