AnimationEvent 'funname' has no receiver!

hello ,the script show the error “AnimationEvent ‘funname’ has no receiver!”。 where is the mistake。thanks

GameObject meshGun;
GameObject water;
AnimationClip gunMove;
AnimationEvent aevent;
void Start () {
meshGun = GameObject.Find(“MeshGun”);
water = GameObject.Find(“5_1MeshWater”);
gunMove = meshGun.animation.GetClip(“gunMove”);
aevent = new AnimationEvent();
aevent.functionName = “funname”;
aevent.time = 0.1f;

gunMove.AddEvent(aevent);

}

void funname(AnimationEvent en)
{
print(“aaa”);

}

AnimationEvents are sent to the GameObject with the Animation. So your script with the ‘funname’ function needs to be located on the meshGun GameObject.

oh… your reply is work,Thank you!!