Opening Doors?

I have made, rigged, and animated a refrigerator for my game, but I need some help playing back the animation.
My problem is I can get it to open, but I can’t get it to close–Well, I can get it close, just not with the same key.
I’m trying to open and close my fridge by using the same key.

Are you trying to do this with logic bricks or Python? I’m guessing logic bricks so I would suggest:

  • Give your 'fridge a boolean property called “open”.
  • You need two “property” sensors. One tied to “open” and the other tied to “not open”
  • You need 2 “And” controllers, one takes your “keyboard” and “open” sensor, the other takes your “keyboard” and “not open” sensor.
  • You need 2 “Action” actuators. One plays the “open” animation from the “keyboard” and “not open” sensors and the other plays the “close” animation from the “keyboard” and “open” sensors.

Beside properties you can use states as well
One state for being open and one for being close. You can play the according animations after changing the state.

If you want it more complex you can use four states:

open
closing
close
opening

:wink:

BTW. you can find a short tutorial in my signature. Look for FSM.