Dealing with two actions in bge

  • I have set up a run-action actuator to an always sensor.
  • I have another sensor attached to a spacebar key for a jump action.

The run action does not continue after the jump action happens. How do i deal with this?

Hi! You have to change the priorities: move action> priority 0 (max); jump action> priority 1 (low)

the spacebar doesn’t initiate the jump action if i change the priorities

So I think you could use the states:

Or properties that represents states, because states are limited, but porperties not(the state limit should be fixed)…

If you want to run two action as the same time (i.e., do action blending) you need to put the actions on different layers. In other words, set the Layer property on jumpact to 1.

If you want the run action to resume playing after the jump animation finishes, then you have the right priorities. Do you have pulse mode enabled on the always sensor (move)?

Moguri is right if the always sensor has pulse mode enabled it has priority on the keyboard sensor that act only on 1 frame, changing the layer of your jump action should arrange the problem. And Keep in mind that priority works like that: 0 = Max priority ; 100 = Less priority that’s why you should set priorities with higher numbers to be able to easily change them in a further state of developement :wink:

Yeah, it is in pulse mode.
Thanks that worked. How exactly does layer property relate to the problem? What does it control?

Layer are controlling the priority of actions if two or more actions are played simultaneously, if an action with priority 5 is triggered during another one of priority 7, the priority five will stop the priority 7 and play instead…