NOT A DUPLICATE adding sound to animation

THIS ISN’T DUPLICATE DO NOT REMOVE! THE OTHER ONE WAS SOUND TO A SCRIPT! THIS IS SOUND TO A ANIMATION! So how do I add sound to a animation? Animation is called reload2

It’s almost the same thing, you put the animation to play and starts the sound:

  animation.Play("reload2");
  audio.PlayOneShot(reloadSound);

DELETE THIS QUESTION!!!

Don’t worry, I am kidding.

There 2 ways ways to do it.

  1. Play sound at same time when you play your animation. You need to add audiosource componenet attached to your object. Component->Audio->Audiosource. And in inspector, select the audio file. Then

    animation.Play(“reload2”);
    audio.Play();

  2. Put your playing audio in animation event function. Its more advanced, I suggest you do it using 1st way.