Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | cyanotic |
Hello,
I am creating a platform shooter game.
I would like to do something similar to what Abuse has done quite a few decades ago.
The lower body and the upper body of my character need to be fully separated, but still, I would like to use sprites.
So, the idea is that I would have two state machines: one for the lower body (legs) and one for the upper body (torso, head, arms) that are animated independently but, somehow, synchronized.
Right now I’m using two separate AnimationNodeStateMachine and a single State Machine to handle the two animations.
This is working flawlessly
- Upper body: IDLE → WALK → IDLE
- Lower body: IDLE → WALK → IDLE
Since the two animations are switching at the same time, they contain the same frames, so the position of legs/arms is always correct.
If, instead, I do introduce something in between like:
- Upper body: IDLE → WALK → FIRE → WALK
- Lower body: IDLE → WALK
The second WALK animation of the upper-body is now off-sync with the lower-body, since the two AnimationNodeStateMachines are playing different frames (e.g. upper body is playing the frame 6 and the lower body is playing the frame 1 of the same animation).
Should I use something different than AnimationNodeStateMachine? Is there a way to implement something like:
“If the upper body is playing ‘IDLE’ and lower body is playing ‘IDLE’, make sure they’re playing the same frame.”?
Of course, this is a simple scenario: I already have more states (JUMP, RELOAD, …) and I would like to be able to perform JUMP-FIRE, WALK-FIRE, RUN-FIRE, JUMP-RELOAD, WALK-RELOAD, RUN-RELOAD, …
I’ve already watched this video as well.
Thanks