Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 I Am The Minion · Apr 19, 2013 at 01:02 PM · mecanimanimationcurvekeyframe

How do you call a specific frame in an animation?

I want to create a script that instantiates prefabs at very specific points in an animation. A baseball is instantiated when a pitcher's arm is at its straightest, or a flare particle system is instantiated in the same moment where match and matchbox connect in an animation. I have some limited experience with hit frames in other engines, but nothing that helps me out here.

I have figured out how to set keys in a mecanim AnimationCurve, and I'm guessing I'm on the right track here. But, I can't figure out how to access those keys by script. What I really want is something along the lines of

//if specific point/key of animation is reached

  //instantiate prefab

Any help?

Comment
Add comment · Show 3
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 MrSteve1 · Apr 19, 2013 at 01:21 PM 0
Share

Are you doing the animation in Unity or an External Program?

avatar image Owen-Reynolds · Apr 19, 2013 at 02:50 PM 0
Share

The old system used time (or 0-1% normalized time) ins$$anonymous$$d of keyframes. If you wanted keyframe 30 out of 45, you checked if normalized time was 0.66666.

Game frames and animation frames may not synch, so you may see frame 29.5 followed by frame 30.7. So you have to check for "did I just now pass time 0.66?" or "am I past 0.66 and haven't thrown yet?"

avatar image I Am The Minion · Apr 19, 2013 at 03:00 PM 0
Share

$$anonymous$$rSteve the animation is being done in $$anonymous$$aya.

Owen Reynolds, I've noticed an animationCurve also has its own time measure 0.0 to 1.0. How would I go about querying those values so I can use them as a condition?

Is there no way to access a key directly? GetComponent().GetAnimationCurveFloat ot something along those lines must exist, I just can't find it.

0 Replies

· Add your reply
  • Sort: 

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

13 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

Related Questions

What is the length of the Keyframe tangent? 0 Answers

How AnimationCurve.MoveKey works? 1 Answer

How do I scale an animation curve by time and value while retaining my tangent values? 0 Answers

How can I give variation to animation curve in Unity? (Raw mocap data) 0 Answers

[Solved]Animation Curve in Code 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