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
3
Question by 3Duaun · Sep 28, 2011 at 03:47 PM · animationanimationeventtiming

AnimationEvent triggered multiple times?

no matter what set of checks I perform on an AnimationEvent that was created on an AnimClip during the "Start" method in a class, I'm getting the method the event calls being triggered multiple times, usually 3-4 times(oddly enough). I've done numerous debug.log checks to test as to how many times the method that triggers the animationClip that houses the AnimationEvent is being called, and it only show that this initial method calling the animClip that houses the animEvent is being called once, yet the debug calls that the method that the AnimationEvent triggers are reporting themselves being called 3-4 times in a single animationEvent call. Has anyone run into this issue for found a fix? Pardon my not posting code, again though I'm simply playing an AnimClip from a method in another class, ONCE, thats it, and I continuously get the debug logs showing the event's method is being called multiple times, yet the event that is triggering the AnimClip with the event is only reporting being called once ??? Thanks for any help :-).

Is this a matter of making the animEvent placed in a "tighter" float position, say as opposed to "0.9f", going with "0.9999999999f". I'm wondering if this event is being called multiple times due to a random lag in gameplay that could occur around the "0.9f" point in the animClip?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
3

Answer by 3Duaun · Sep 28, 2011 at 04:16 PM

No need to "thumbs up" this answer, I just want to archive it for the community. It appears that, in our case, we're using a PoolManager of sorts for "enemies" in a title we're currently developing. The "Start" method activates on EACH of the SAME enemies that are being pre-pooled(mostly for mobile performance), the same additions of the same animationEvent to the SAME ANIMATION CLIP somehow, as if they're all sharing the same animation clip amongst the multitude of individually instantiated enemies of that type. So for future reference, do a check for a pre-existing event of that name(perhaps at that time), and dont add it again if it already exists; just a heads up in case anyone else runs into this issue.

Comment
Add comment · Show 3 · 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 3Duaun · Sep 28, 2011 at 04:55 PM 1
Share

just found this answer that wasnt showing up at all before?? http://answers.unity3d.com/questions/125193/enemies-spawn-with-multiple-of-the-same-animation.html

avatar image Bunny83 · Sep 28, 2011 at 05:14 PM 2
Share

Yep, i also had to learn this the hard way :D, but it all makes sense once you get it. Animation-Events are "usually" added in the animation window where you edit your Animation-clip. This clip can be shared between many objects. However imported animations (almost) can't be edited so you need to add the events via script.

I recommend to add the events in some kind of manager-script that exists only once in the scene. This manager class only needs the AnimationClip references.

Another way is to use an editor script to "clone" / "copy" the animation and save it as true, seperate .anim file. This one can be edited in the animation window. The problem with this method is that you can't really update the AnimationClip since it's a copy.

avatar image KarimWixel · Jan 28, 2013 at 04:11 PM 0
Share

Thanks a lot, I suppose you just saved me a lot of time! :)

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to prevent an animation from triggering more than on due to fast clicking? 2 Answers

AnimationEvent not reliably triggerd on iPhone 1 Answer

AnimationCurve for ScriptableObject 0 Answers

Animation events won't trigger if animation time set manually 1 Answer

StateMachineBehaviour is working weird with AnimationClip.AddEvent 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