State 1- Go up, State 2 - Go down (Easy? well, not for me!)

I’ve figured this was an easy piece to get grips with states!

I wish to make a force setting interface for players, based on a shape key that goes
from 0 to 100 in 100 frames, then drops back to zero, and then switches back toward 100 again, an so forth

1- Start at 0, set force property to frame number (100 frames) of shapeAction while key is held
2- if reach 100. change state and continue to 200 (ShapeAction going in opposite direction toward base shape)
3- if 0, change state again to go back up!

4- when ready click somewhere, read property, set force on object and shoot! (type of thing to do. right now, just working on forceIndicator)

Here’s my blend example (not working) can any one point what I’m doing wrong?

Thanks

Attachments

indicateurForce.blend (295 KB)

You do know the simplest way to change states is to use a state actuator set to this.

STATE ACTUATOR:
-set to cpy
-second state button selected

Once you know that and set the sensors it should be straightfoward, you may need to set the property actuator to detect a small range around 100 if you have it going up in a way that can have it skip values.

Thanks Cyborg, but isn’t it how I connected them in my example???

State 1 - 2 sensors
sensor 1 - activator 1- shape Action from 0 to 100, set force property to frame
sensor 2 (if force property equals 100) Activator 2: state activator, cpy to state 2

then it should in State 2 (?)

State2 - 2 (connected) sensors
sensor 1 - activator 3- Activator 3: shape action from 101 to 200, set force to frame
sensor 3 (if force property equals 200) Activator 4: state activator: cpy to state 1

What am I doing wrong?