Unity

How to fix AnimationEvent ‘Hit’ on animation ‘Attack1’ has no receiver! in Unity

投稿日:

Overview

When we got free Animation at Unity Asset Store and used it with SimpleAnimation, I encountered following error.

AnimationEvent ‘Hit’ on animation ‘Attack1’ has no receiver! Are you missing a component?

To come to the point, the error could be fixed by deleting Animation Event from the Inspector.

The following shows how to fix it step by step.


Environments

Windows10
Unity 2020.1.f1


When error happened

We used two packages, Robot Kyle from the Unity Technologies and
WARRIOR PACK BUNDLE 3 FREE Animation from Explosive to control Robot Kyle with attack animation.

Robot Kyle

https://assetstore.unity.com/packages/3d/characters/robots/space-robot-kyle-4696#reviews

WARRIOR PACK BUNDLE 3 FREE

Attack1 Animatino in Karate module

To call animatoion, we set Attack1 as Elemtin3 in SimpleAnimation script.

We started game and execute Attack1 animation , then the following error happened.

‘Robot Kyle’ AnimationEvent ‘Hit’ on animation ‘Attack1’ has no receiver! Are you missing a component?



How to fix

The error show the cause is ‘Hit’ AnimationEvent in the Attack1.
If you don’t need to use ‘Hit’ Event, Deleting it is good way.


Copy the Animation

Before deleting ‘Hit’ event in Attack1 Animation, we copy it.

Selecting Animation(FBX) and press Ctrl + D can make copy file and also can be renamed by F2 key.


Deleting ‘Hit’ Event

Now selecting the Attack1 Animation in the copied file and open the Inspector.

Click the Edit button at the top right in the Inspector.

Opening the Event at the bottom.

You can find event in the timeline.

Right clicking the event and deleting it.

Pressing Apply. If you forget to apply, it may make the same error again.


Test

Change the Attack1 in the Simple Animation Element to the new one you deleted the ‘Hit’ event.

Starting the game again and check the character can move without error.

-Unity

執筆者:


comment

Your email address will not be published. Required fields are marked *

関連記事

【Unity】Object starts to chase the player approaching

Contents1 Overview2 Environment3 Picture of implementation4 Step1 : Set the player5 Step:2 Cube Object chasing player6 Step : 3 Script7 Step : 4 Test Overview There is a sample the Cube Object starts to chase the player who goes in a certain area around it. Environment Unity 2020 1.1f1Windows10 Picture of implementation Step1 : Set the player Ethan from the Standard Assets can be used as a human object. Flowwing article explains how to set Ethan and move him. 【Unity】Standard Assetsでサクッと人間をキー操作する After place Ethan on Terrian, set the Tag in inspector “Player”. Adding rigidbody and capusule collider is needed. Step:2 …

【Unity】The way to fix error CS0619:’GUIText’ is obsolete:’GUIText has been removed. Use UI.Text instead.’

Contents1 Overview2 Environment3 Occurences4 The way to fix it Overview There occured error CS0619:’GUIText’ is obsolete:’GUIText has been removed. Use UI.Text instead.’ to use Standard Assets. This article shows a way to fix it. Environment Unity 2019.4.3f1 Occurences Making C# script from Assets > Create > C# Script . Attaching the script to Sphere object by drag & drop, I get message ‘Can’t add script’ . This massage warns that the name of the script is different from its class name or there are some error of compiling. But I don’t find any error for compiling or the difference of …

Language Switcher

Categories