Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Different animation based on equipped weapon

Discussion in 'Animation' started by VenomSNNNK, Jul 22, 2021.

  1. VenomSNNNK


    Mar 8, 2021

    I am working on different weapon attack animations in Unity. Until now I had all character animations on Player Animator, and everything went smoothly (walking, running, jumping etc.). So now I want to implement sword fighting animations. I have created Weapon Interface from which my sword inherits basic functions (Perform Attack). My problem is when I spawn sword object as a child in my Player Model I can't find the way to start slash animation from Sword.cs with animator.SetTrigger("Base_Attack").

    What I want to archive is to start slash animation on whole Player Model using script attached to equipped Sword that is new object spawned as child on Player Model but have no clue on how to make it working. I tried to attach new animator to Sword Model then I could see in Animator that Slash Animation is triggered but that's it, cause in the scene nothing changed, no animation was playing.