• 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
1
Question by Romano · Jun 07, 2014 at 03:57 AM · triggermultipleanimationevent

Animation event fires three times on the first frame - is this a known issue?

Howdy, I have an animation with an event on the second frame and one on the last frame. The function that the events trigger takes an AnimationEvent as a parameter and prints the time that the event is triggered.

Triggering the animation gives t$$anonymous$$s result:

alt text

w$$anonymous$$ch is exactly what I would expect.

What I really want is to have the first event to be on the first frame, but when I move that event onto the first frame (so there is just one event on the first frame and one on the last) I get t$$anonymous$$s result:

alt text

As you can see, the function is triggered 4 times. Twice at the beginning, once at the end, and once at the beginning again. I'm not doing anyt$$anonymous$$ng different other than moving the event between the second and first frames and the animation plays normally both times.

Has anyone had the same problem?

The function just looks like t$$anonymous$$s:

 function PrintTime(animEvent : AnimationEvent)
 {
     print(animEvent.time);
 }

Thanks very much,

Romano

edit: I'm using Unity 4.5 and haven't tried using animation events before t$$anonymous$$s.

2014-06-07 10_48_47-clipboard.jpg (27.7 kB)
2014-06-07 10_47_43-clipboard.jpg (16.2 kB)
Comment
Add comment · Show 4
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 IntDev · Jun 09, 2014 at 05:02 PM 1
Share
avatar image Romano · Jun 17, 2014 at 06:00 AM 0
Share
avatar image smoggach · Aug 11, 2014 at 04:21 PM 0
Share
avatar image aznxluvlyguy4u · Aug 26, 2015 at 12:35 PM 0
Share

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by smoggach · Aug 11, 2014 at 04:40 PM

If your animation is on the default state of your animator it will play when it wakes up. Set your default state to one without an anim on it. The default state is the orange one.

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 Romano · Aug 20, 2014 at 04:37 PM 0
Share

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

24 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

Related Questions

Multiple triggers on one object 8 Answers

Animation Event Keys Not Triggering Due to Low Framerate? 0 Answers

checking to see if multiple (different) tags are destroyed 2 Answers

Detect more than one collider trigger 2 Answers

Child collider triggering parent collider effects. 1 Answer


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