I currently have this issue of properly transitioning one animation to the next after it has finished.
Im previously used statemachinebehaviour to disable variables from this thread
This is my script
if (player_movement.VaderAttack1 == true)
{
anim.SetBool("VaderAttack1", true);
//detects when 1st animation has ended before starting the second
if (player_movement.VaderAttack2 == true && !anim.GetCurrentAnimatorStateInfo(0).IsName("Vader attack1")) //check when 1st attack anim has finished and 2nd anim has been called
{
anim.SetBool("VaderAttack2", true);
}
else if (player_movement.VaderAttack2 == false && anim.GetCurrentAnimatorStateInfo(0).IsName("Vader attack1") && anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1.0f) //check if 2nd anim isnt called and disable 1st anim var after it is finished
{
player_movement.VaderAttack1 = false;
anim.SetBool("VaderAttack1", false);
}
if (player_movement.VaderAttack2 == true && !anim.GetCurrentAnimatorStateInfo(0).IsName("Vader attack2")) //disables 2nd anim var after it finishes
{
anim.SetBool("VaderAttack2", false);
player_movement.VaderAttack2 = false;
player_movement.VaderAttack1 = false;
}
This would be super easy with Animancer (link in my signature) using its End Events.
I’m not sure exactly what you’re trying to achieve, but if you just want to make a simple attack combo system then the Weapons example explains how I would do it.
Alright thanks, ill try the end events out.
I got my own weapon combo working, but the game doesnt want to detect when an animation has finished so Ill keep your tutorial in mind.
Now Im just detecting if the animation is running, but when both both the animator bool and normal bool are enabled, while the animation is stuck at the end without transitioning anywhere, the elseif statement doesnt succeed.