Adding Sword Arc
2D Mobile Game
Objective: Create a sword arc when player attacks.
First to create this animation, you need to create a new gameobject which you will create by dragging the first animation sprite inside your player gameobject.
Then with that selected, create an animation to that gameobject and make sure to place the second animation sprite and onwards after 0.12 sec to align the animation with the sword movement.
Also change the transform of the newly created gameobject as given above to match my animation.
Then create a new Trigger animator parameter which will be used to play the animation. Then create an empty animation and set it as default to make sure that sword arc animation doesn’t play with game start. Then create transitions both way and set the condition for trigger to play animation without exit time and with transition duration 0 for none to Sword animation and as for the sword animation to none, keep the exit time and transition duration to default while keeping the conditions empty.
Then inside the player animation script, create a animator reference variable and set the reference to the 2nd child(Sword_Arc gameobject).
Then inside the Attack method, set the trigger for the sword animation and you are set.
And this is the final result.