Hi, any help here would be great, this player will have about 8 animations, what is the best way to create some sort of state machine. what is the best logic to use because here its no good. the player is still running when jumping.
Use platform Behaviour.
make floor is solid
players is on floor set animation to idle.
Im not sure that's going to work for multiple states. The floor is currently solid but that's not going to help with a transition between running and jumping. I dont think anyway?
What will be your 8 animations?
If I had to do myself a state logic for multiple animations on a player, I would do a global variable with a string.
In short, the initial value will be "idle". So, all your animation will be states like for example "jump", "fall", "hit", "attack", "protect", etc. All triggerable by keys or events or whatever you want them to get triggers.
Then, inside a group (in the event sheet), you check:
if the global variable value is "idle", then play idle animation.
if the global variable value is "run", then play the run animation.
And go on.
Do you think this idea can fit your needs?
Develop games in your browser. Powerful, performant & highly capable.
Hi thanks for the reply. I have read about others doing this and for them it worked well. My game will be run and gun, so the player will need to shoot while running and jumping, there will also be slides and crouching so not sure if it would work? i guess it would as long as i assign a condition to the variables no?
This video goes into detail about importing animations and, in the second half, triggering them.