#State Machine problem

1 messages · Page 1 of 1 (latest)

lyric hemlock
#

Hello, i followed a DevWorm tutorial about statemachine, and did exactly what he did, but when it came to test the animation "run", it did work as you can see on the video.
any idea about why it just spam the first frame out of 16?

autumn ice
#

Have you tried adjusting the speed of the animation?

autumn ice
#

Try slowing down the animation in the code. It wont be a good fix but maybe that is all that is nessecary

lyric hemlock
#

the speed of my animation isnt in the code how can i do it?

autumn ice
#

Not quite sure to be honest, although it should be pretty easy

#

I can check

#

animationPlayer.playback_speed = value

#

There we go

#

try that :)

lyric hemlock
#

damn thanks for your help!
where do i put it in my code?

autumn ice
#

Maybe first in the run func?

lyric hemlock
#

animation player and value are not defined in my code

#

how did you define them?

autumn ice
#

Value is what you change it to and try refering to your animatedSprite instead of animationplayer

#

So value could be for example 2

lyric hemlock
#

sadly nothing works

spark jetty
#

There is a posibility that you’re going from idle to run really quickly and that is causing your problem

fluid shuttle
#

Oh sorry it was in the first screens

#

Line 89, what exactly calls run_update ?

spark jetty
fluid shuttle
#

This seems like it

#

I'm working on the state machine of my project rn and this one seems a bit compliated to use

lyric hemlock
spark jetty
#

No problem man

#

I had a lot of trouble with FSMs when I first started using them