x


Animation playback speed control in Unity?

In my game, I need the speed of enemies (but not anything else) to increase as the game progresses, and/or base on enemy type. To do this, I was planning on setting the animation playback speed in script, as they use randomly selected animated paths. However, looking at the Animation script reference, as well as the Animation interface guide, I can't seem to find any way to do this. Is this really not an option? Do I have to create new animations for every increment of speed? I hope I can adjust the playback speed as I like to play with things like enemy speed when finding the feel of a game. Also, don't most 3D games that use analog control for the speed of a walk/run also adjust the speed of the animation (along with blending between other animations)? 3D game basics like this are why I feel like I must be missing something. Thanks for your help!

more ▼

asked Nov 28 '09 at 12:36 PM

jellybit gravatar image

jellybit
145 2 4 12

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Look in docs for AnimationState.speed

more ▼

answered Nov 28 '09 at 02:35 PM

Jaap Kreijkamp gravatar image

Jaap Kreijkamp
6.4k 20 26 70

Oh man, thank you. Sorry to ask something so obvious! I can't believe I missed that.

Nov 28 '09 at 02:44 PM jellybit

Actually, I think it's not that easy to find. I had been looking for that a while back, too - and only ran into it by chance (but at least I did run into it ;-) ). I guess that would be worth a little addition to the Animation script reference and Animation interface guide.

Nov 29 '09 at 11:20 AM jashan

Don't feel bad at all, the difference between animation and animation state is far from obvious in the Unity documentation.

Jul 22 '10 at 11:10 AM MaDDoX
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5056
x3768
x56

asked: Nov 28 '09 at 12:36 PM

Seen: 7065 times

Last Updated: Nov 28 '09 at 01:28 PM