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”);
}