Error at bottom of screen at end of video?

At the end of the video, and in my own project, Rick is getting this error:

'Player' AnimationEvent 'Hit' on animation 'Unarmed-Attack-L2' has no receiver! Are you missing a component?

What causes this, how do we correct it? This is probably the first error I’ve seen that wasn’t addressed in the video before it ended

Oh, there have been plenty of other errors hiding on the screen during recording. :slight_smile:

This particular error is caused when an animation event is fired in an animation (in this case Hit within the Unarmed-Attack-L2 animation) and there is no component on the GameObject holding the Animator with a function Hit() in it.

The way Animation Events work is that when the Animator sees an Event in the Animation, at the proper time it broadcasts an Event by that name to all behaviors on the GameObject. If no components have such a method, it throws the error to let us know we should address the issue.

It shouldn’t have fired in the video, as the Animation would have been called from Fighter, and Fighter should have a Hit() method in it (which is where we do the damage). One of life’s little mysteries.

This topic was automatically closed after 19 hours. New replies are no longer allowed.

Privacy & Terms