Ads keep us online. Without them, we wouldn't exist. We don't have
paywalls or sell mods - we never will. But every month we have large bills
and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3
This Question has been answered but no solution has been chosen.
You can still post your own answer to help the submitter.
How do i make a certain animation play during sonics double jump? im trying to make this animation the floating animation for a swimming mod. and i want to know how to make it play while only underwater
Make a global variable that gets set when you activate the swimming (call it something like sonicIsSwimming) and set it to 1 when swimming's active and set it to 0 otherwise. Then, in the animation script (Standalone.drawCharacterSprite()), add a check for the sonicIsSwimming variable and change the key to the swimming sprites like this:
key = stringformat("character_sonic_swim_0x%02x", (level.framecounter >> 3 % 4))
else if(animationSpriteEx >= 0x100)
... // Rest of the vanilla code here
You can mess around with the numbers to change the speed & number of frames for the animation (the % 4 part controls how many frames the animation has). You'd also need to set up sprites for it, using the format character_sonic_swim_0x%02x, where the %02x would be replaced with the number of the frame. You'd set this up like any other sprite mod, and I've got a pretty good guide of how to do it contained within the files of Super/Hyper Sprites (specifically for the standing sprites, but the method here's the same).
This would give you a fully-custom animation without having to sacrifice any of Sonic's vanilla animations.