How Do I Make Random Attack animations? (solved)

i want to make it so that when you press space (space is to attack) it does a random attack animation instead of playing the same animation. heres my code btw:

There is a random behavior that can assign a random number, then have filters to detect specific number.

You could also use the router behavior and just randomize the next route. (I think this works as well, I mostly use Random and filters.)

3 Likes

can you show me a picture?

4 Likes

meesa try it out

well if you want random then you need a random number generated when the switch outputs
So don’t copy @CodeAlpaca 's code directly

What?

That’s what the router does, it will randomly assign a new direction every input. You don’t necessary need to have a number unless you’re using the Random behavior.

I find the router more easy and simpler to use since it’s just a single behavior whereas using the Random behavior, you’ll need a ton of filters to extract what the number is being generated.

3 Likes

oops! I made a mistake. I don’t normally use that setting on a router.
Heh :sweat_smile: and code alpaca even opened the behaviour to show the setting

3 Likes

oh so i don’t need to do anything? so i can copy @CodeAlpaca exactly? @ManiacPumpkin @Flying_Fajita

3 Likes

yes

1 Like

oh ok thanks!