Animation Event won't show the function I need

I’m trying to add a function to fire on a certain frame, but the function I need will not show up in the edit animation event window. How do I fix this?

Old question but I worked this out, if you select an animation clip in the Project explorer and try and edit an event’s properties it wont show a list of available functions.

However If you select an object in your scene graph with an Animator component then bring the Animation window and select your clip in the dropdown it will show a list of functions you can call. It makes sense because Unity won’t know which functions it can call just by editing the animation clip asset, it needs the context of the game object that’s playing it.

Check out this answer: Why don't animation events allow you to call functions that take a bool parameter? - Unity Answers

If you have a boolean parameter, it doesn’t show

animation event calls public methods of other components attached to gameObject playing the animation

so basically make component (monobehaviour class) AnimationEventListener and make public method like

public void EventHandlerMethod()
// the code you need

attach it to the gameObject in scene and it should appear in the dropdown menu of AnimationEvent keyframe

For anybody else who lands here, the animator can only call methods with a single parameter. If you have several parameters, it won’t appear on the list. You have to pass a parameter of type AnimationEvent . Here are more details: One parameter limit on animation event functions temporary? - Unity Answers

Old question, but another issue that might cause this is attaching the script to a child of the object holding the animator, the script must be attached to the parent object for the function to show.

but how can I fix the problem if I want to call a function that is in another game object that the animation clip is on, the function is public and I tried locking the inspector on the animation clip, then selecting the game object that has the function I want to call but still no result ! @GearKlik

I used a public function and put the script into the game object with the Animator component.