Destroy obj when specific animation plays

Hello everyone, I’m new to Unity and so far I’ve been able to do ok on my own but now I am stuck.

I want to trigger “destroy obj” when a specific animation plays.
I still don’t know how to code, so, I’m using the scrip graph to code my project.

Could someone help me kindly?
Thank you.

You can use an animation event to call a method to destroy the game object.

  1. In a script that is attached to the GameObject that has the animation, add a method like this:
public void FunctionToDestroyObj(){ Destroy(gameObject); }
  1. Open the animation timeline and on the last keyframe of the specific animation, click the add animation event button.
  2. Click the animation event and in the inspector, you’ll see a drop down menu to select the method to call. Set it to the method FunctionToDestroyObj