1

I'm trying to script an sprite animation event for my player's character shooting animation, where the first frame of the sequence is the only one shown when no bullet is shot, and when you shoot it plays the rest of the frames.

I can see the animator window for the controller has an option to create new states and connect between them. The "Motion" row of the states accepts animation files (clips?), so I tried creating new Animation to put the shooting frames in, but it has no sprite properties in it as the automatically created Animation file (when importing the PNG sequence) has, I can't add anything and it doesn't allow for new keyframes to be created. So how do I actually use that to create an animation sequence for the animation state?

Thanks in advance.

TLSO
  • 322
  • 3
  • 17

1 Answers1

0

I feel like it would be best if you rephrased / elaborated a bit more in your question. So i'm going to answer it the best I can. If you want to do it by script, you can try this answer:

https://answers.unity.com/questions/1031965/how-to-create-animation-event-at-specific-keyframe.html

If you want to add an event clip in the animation itself, try this:

https://www.youtube.com/watch?v=3_ZFSZr-sJI

Kale_Surfer_Dude
  • 884
  • 5
  • 10
  • I've eventually used the way in this tutorial and it worked fine. It requires you to create the new clip files from the animation menu after you select the sprite object you're animating and then it works. https://www.youtube.com/watch?v=hkaysu1Z-N8 – TLSO Apr 25 '20 at 15:44