How do i get animations from different substates to play their set of animations inside the substates?
Im making an FPS game where i have an animator to control the different animations of my 5 different guns, each having their own substate. I have each one connected to each other through a transition where if i press a number, it should switch to the desired substate and start playing the animation for the gun. However when i press number 3 for example, it doesn't play the animation set for the gun 3 substate and only plays the default gun's substate.
Here is the code for transitioning to each weapon, weaponType being the condition in the animator to keep track of what gun is selected
if (weaponType == 1)
{
playerAnimtor.SetInteger("weaponType", weaponType);
yield return new WaitForSeconds(0.75f);
makarov.SetActive(true);
ppsh.SetActive(false);
mosin.SetActive(false);
dp28.SetActive(false);
sks.SetActive(false);
weaponSelected = 1;
}
Base animator picture: https://gyazo.com/b7323dff07bdb6369efadbea70365014
Inside the substate of one of the guns: https://gyazo.com/c49adfcd64ede9c18ba611c0944303eb I made one animation set with my pistol, then copy and pasted it 4 times for the other 4 guns and switched the animations to fit the gun, so they all have the same conditions for moving.
Your answer

Follow this Question
Related Questions
How do I puse an animation? 1 Answer
How to set the blend tree threshold value during run time? 0 Answers
Continuous keydown in Animator 0 Answers
Animation Running Game 0 Answers
Syncing Animations both playing from Seperate Animators 0 Answers