I spent the better half of today coming up with a solution to the following problem: You can’t set animation playback speed directly from the Editor.
You end up having to code the speed change into one of your scripts and that’s not a scalable solution that can be applied to all the other GameObjects in your scene that have Animation components.
You can read the detailed explanation of the solution over at my blog: Solve the System
Instructions:
Download AnimationSpeedEditor.zip, which contains two script files: AnimationSpeedEditor.cs and OverrideAnimationSpeeds.cs.
Place AnimationSpeedEditor.cs inside a folder named Editor in your project. Create the folder if it doesn’t exist. The other script file can be placed pretty much anywhere.
Find or create a game object that has an Animation component attached, and add the OverrideAnimationSpeeds component to it. You should see the Animation Speeds foldout get added to the view of the Animation component.
Open the foldout. If you have animation clips added to the Animations list of your Animation component, you’ll see sliders for each one. Use these sliders to set a starting speed for your animations. You can also use the sliders during Play mode and see the results immediately.
jrricky, I don’t quite understand what you mean. The two scripts used in this solution only rely on each other. Your JS scripts should work fine alongside them.
Wow, this works wonders. Funny thing is, I was just having problems with the animations I have created over the weekend and the speeds I created them at werent syncing with each other and this just make the process very easy. Thanks!!!
Hey VoxelBoy, one thing I would like to ask is that, if I want to modify the speed by code to, for example, speed up a character, what would you recommend I do while still using this?
The OverrideAnimationSpeeds script applies its overrides on Awake. So you can set your own speeds from code while still using this script if you do it anytime after Awake, such as Start or Update.
Hey, I came back to using your script, but I wanted to find out how I would call the script so I can change animations on the fly when I want through that script?
Something like OverriderAnimationSpeeds.Change(animationname,speed);
Zionmoose, not to plug my own Asset, but check out ASE too from the Asset Store. It’s the same concept but I have made it more robust. It’s also now on sale for $5.