Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by pigaroos · Feb 05, 2019 at 07:41 PM · animation events

"objectName AnimationEvent 'methodName' has no receiver! Are you missing a component?"

I'm making an animation that has an animation event at the end of every loop that calls a function in a script. But I keep getting that error when they loop, and yes, I assigned the script to the animation event in the Inspector.

 void IncrementAnimationTimer()
     {
         StartCoroutine(WaitForABit());
     }
 
     IEnumerator WaitForABit()
     {
         yield return new WaitForSeconds(2.0f);
         anim.SetInteger("Counter", Counter);
     }

Have no idea what's happening here, maybe I need to assign something else in the Inspector? alt text

screenshot-313.png (17.3 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Chimer0s · Feb 07, 2019 at 10:20 PM

That error means that the object with the Animator that calls the event doesn't have the script attached that contains that function. Any chance you forgot to place the script on the gameobject?

Edit: I should clarify how the fields of the event window work to avoid future confusion, as well. The fields below function are for passing values to that function, i.e. for instantiation. Say you wanted to instantiate a prefab with a function like CreateObject(GameObject thingToInstantiate). In the event window you would put "CreateObject" in the Function field and the prefab in the Object field. Then the receiver would have the function called with the prefab passed as the GameObject value thingToInstantiate. The only way this works, though, is if the gameobject with the Animator attached also has the script with the function attached. That's where it gets the reference from.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image pigaroos · Feb 08, 2019 at 12:08 AM 0
Share

@Chimer0s Thank you! What happened was that there were 4 game objects. 3 of them were having the function called no problem (but my function didn't work) and one that was a little different from the others (not having the appropriate script as you said) pumping out an error. So I though all of them were malfunctioning because my function wasn't working correctly and one was pumping out an error. Again, thank you so much!

avatar image
1

Answer by $$anonymous$$ · Feb 06, 2019 at 11:49 PM

I don't know the full context of this, but if it says it has no receiver, then it has no receiver. I suggest using Debug.Log to find out why the receiver isn't being set.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image pigaroos · Feb 06, 2019 at 11:52 PM 0
Share

Thanks for the suggestion. Basically, I wanted an animation to loop but with a few seconds in between (without animating that delay itself). I made a function that starts a coroutine which counts a few seconds and resets and blah blah blah, and at the end of every loop there is an animationEvent that executes that function, but I keep getting this. Also, I've tried the debug.log and it prints the message but still gives the error... interesting

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

98 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

multiple Animation Events in an Animation 0 Answers

Issue about transforming animation in animation event and then in update function continuously 0 Answers

Can't select and move few animation Events at once 0 Answers

Changing only one axis(Transform.Position) in Animation Event 1 Answer

Cannot select function for Animation Event 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges