What is this assert trying to tell me? The animations are working just as I would expect, but I get 3 of these each frame.
If you change the layer more than once during your update you’ll get this harmless error message.
Its better to do the layering stuff at Awake or Start, saves doing it every-time during update or whatnot…
I am having this issue and I have no clue what it is…
What do you mean “If you change the layer more then once during your update”???
Thanks
It clearly doesn’t seem to reflect a real problem with the running of the game.
If you are correct then it should be a Warning and not an Error and it should output a descriptive string giving you a clue about what to do to fix it.
Also, if at all possible, it would be nice to have a way to let the system know when performance isn’t a concern and ease of development was chosen on purpose so ignore the warning.
I’ve got this same warning (error?) printing several times per frame 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.
I found and fixed the problem in Unity.
You 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
theAnim.AddMixingTransform( theLHandTransform );
theAnim.layer = theHandLayer;