So, I was playing around with Blender and I figured out how to use the state actuator, it is really powerful! I thought I'd write a tutorial about it so you can use it in your games too.
Not a pure beginner tutorial (I'm not going over hotkeys and such).
We (mostly you) are going to make a cube that, when you press 'shift', goes into running mode and back to walking when 'shift' is pressed again.
First, add a cube (or use default) and a plane (scale up 10-20 units). For ease of visibility, make the plane a different color than gray. Select the camera (or add one if needed) and position it above the cube and parent it to the cube. Select the cube and add three keyboard sensors make them w, s, and shift keys. To make things easier later name them “w key”, “s key”, and “shift” (you can minimize them now too). Add three controllers(only using 'and' controllers), two motion actuators (name them "fwrd walk" and "back walk"), and a state actuator (name it "running"). Link like in the picture.
Make the fwrd and back walk actuators Loc 0.1 in your forward direction and -0.08 in the backwards direction. Note that you could use just one motion actuator if you wanted the same forward and backwards speed. I am making mine different speeds for realism. Now for the running actuator. At first glance, it looks similar to the layers buttons (that you are hopefully familiar with). These layers correspond to the layers above our controllers. Set the running actuator to the second layer (also make sure it says 'Cpy'). Now go to the layers buttons above our controllers and select layer two, and notice that all the connections have disappeared. Add three more actuators - “walking” a state actuator with layer one selected, "fwrd run" and "back run" motion actuators (I used .3 and -.25 for my speeds). Link like in the picture.
Go to camera view and try it out. Hope you find them as cool and useful as I do. Below is for some practice.
Now try adding a duck mode. You will need to use a third logic layer, keyboard sensor, state actuator, and one or two motion actuators. After you get the movement working, add an ipo to the camera making it go down, and mix that into everything so ducking has the ducking effect. You will probably need to use property sensors and actuators to control the ipo actuators on the camera (like ducking equals true or false).




