x


Animation clips - what is normalizedSpeed actually doing?

I've read the manual definition of normalizedSpeed, but it's not clear to me what is really going on with it. And a forum search didn't turn up anything useful.

Here is the situation: I have a simple Blender model with a 5-second animation, set to 30 frames per second. When I play it in the Unity Game window or a Web browser, it takes 10 seconds. When I play it in a Windows stand-alone executable, it takes 5 seconds.

After printing various debugging information on the animation clip, I see that:
Animationstate.length = 5 seconds - as expected.
Animationstate.frameRate = 30 frames per second - as expected.
Animationstate.speed = 1
Animationstate.normalizedSpeed = 2 (not expected or understood).

I changed normalizedSpeed to 0.5, and my animation then correctly took 5 seconds to play - in the Game window and Web browser. A stand-alone executable took 2.5 seconds to play the animation. Hmmm...

Several questions - First, why is normalizedSpeed getting set to 2 in the first place? Is there some interaction with Unity's default framerate? I assumed that Unity ran at the highest framerate it could (and in fact, when I put up an FPS counter, it was in the hundreds in my Web browser).

Second, is there some way to set animations to run at the same rate in a browser and executable? Although I'm more concerned with the browser working correctly, I would like to know how to make an executable behave the same, without any hard-coded exceptions.

Just added a third question - I tried lowering normalizedSpeed on a half-second long animation, and it seems to have made it take longer? So is normalizedSpeed trying to adjust every playback time towards one second (or something)?

Update: I have discovered, from a different question, that one of my assumptions about framerate was wrong (the Web browser is capped). When I set my frames-per-second to 30, then the animations play at the same speed on both the standalone executable, and a Web browser. So that is not actually a bug, and I'll close the bug report.

However - it still isn't working as expected. A four-second animation takes eight seconds to play (but at least it's the same everywhere :) . There must be something I'm doing that affects playback speed, will continue to research it.

more ▼

asked Feb 21 '10 at 08:24 PM

Cyclops gravatar image

Cyclops
7.1k 33 63 115

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

2 answers: sort voted first

To partly answer my own question, I found another post asking what normalizedSpeed does, with a good answer. And yes, I did a search before posting my question. :) Unfortunately, the other post typed it as two words, "normalized speed", and Search didn't find it.

"What is the meaning of normalized speed"

It doesn't explain why the difference in stand-alone versus browser Animation speed, but hopefully the previous answer/bug report will address that.

more ▼

answered Feb 22 '10 at 07:13 PM

Cyclops gravatar image

Cyclops
7.1k 33 63 115

Don't forget that searching on google is faster and more reliable than using the built in search, just by appending the "site:answers.unity3d.com" to your query!

Mar 17 '10 at 01:10 PM Lipis
(comments are locked)
10|3000 characters needed characters left

If the animation plays differently in the editor and in a standalone, that's a bug. This certainly doesn't happen normally with animations, so we'd appreciate if you could submit a bug report with an attached project folder that includes the problematic animation, and a scene that plays the animation and which can be used to see the difference between playback in the editor and in the standalone. This will help us to fix the problem.

more ▼

answered Feb 22 '10 at 10:56 AM

runevision gravatar image

runevision ♦♦
8.1k 29 46 112

Bug report sent, thanks.

Feb 22 '10 at 04:24 PM Cyclops
(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:

x3776
x177

asked: Feb 21 '10 at 08:24 PM

Seen: 2280 times

Last Updated: Mar 17 '10 at 01:28 AM