Hi , i found it a littlebit hard to deeply understand how the animation system works ?
1st : The IsPlaying(name) function is a bit missleading.It actually returns true if the currently playing animation name and the name you check is matching , and NOT if the animation is actually playing (currentTime == length).
Isn’t the IsPlaying(name) should be :
bool AnimationController::IsPlaying(const Urho3D::String &name)
{
AnimationState* state = GetAnimationState(name);
state ? (state->GetTime() == state->GetLength() ? false : true) : false;
}
2nd What are layers ? I tried everything to undertand them , but all they do is playing the animation with highest bit
for an example :
animCtrl->PlayExclusive("walk.ani" , 1 , true , 0.1f);
animCtrl->PlayExclusive("idle.ani" , 2 , true , 0.1f);
animCtrl->PlayExclusive("jump.ani" , 4 , true , 0.1f);
animCtrl->PlayExclusive("aim.ani" , 8 , true , 0.1f);
if i execute this code the “aim” animation will be playing like i just played the aim animation on layer 1 without playing the other animations… So i don’t see the purpose of the layers
how do they actually work and what do they achieve? Can someone show me an example how to use them ?
Thanks