- Home /
prevLayer < state->GetLayer() printed when playing an animation
I've got this same warning (error?) printing three times whenever I play my "lhand-" animations. This behavior started after I started setting my animation layers accordingly in a component's Start() function:
var theHandLayer : int = 1;
for( var theAnim : AnimationState in playerAnim ) { if( theAnim.name.Contains( "lhand-" ) ) { theAnim.layer = theHandLayer; theAnim.blendMode = AnimationBlendMode.Blend; theAnim.AddMixingTransform( theLHandTransform ); } }
This doesn't print if I set that layer to be 0, but that's understandably not too useful to me. What's the deal? My animation plays exactly as I'd expect it to, and I play it from within an update whenever I detect a fire-key-down. Is there somewhere else I'm supposed to be triggering animations (especially ones for higher layers) from?
Answer by Paulius-Liekis · Apr 11, 2011 at 12:50 PM
I think it's a bug on Unity side (it sounds like internal assert). Can you make a mini repro project and submit a bug? It would be nice if you could post case number here too.
Edit:
I found and fixed the problem.
You actually shouldn't disregard the assert - if you get the assert it means it might result in incorrect blending. You can avoid the assert by switching the order of these lines (just set layer after applying mixing transform), i.e. you should do this
aaa.AddMixingTransform( attackMixingTransform );
aaa.layer = 1;
Thanks for the advice, I posted it to them and its case number is 398981.
Thanks, I'll order my code accordingly from here on out. Now that the problem is fixed, would that ordering be considered a temporary workaround until the next release of Unity? Just curiosity :).
Yes, the ordering is a temporary workaround. I expect the fix to be shipped in Unity 3.4.