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 /
  • Help Room /
avatar image
0
Question by JefferyWright · Jan 21, 2016 at 05:59 PM · animationguibuttoneventtimeline

Prevent Animation From Playing Until Button is Pressed.

I have an animation with keyframes, it begins automatically when the player is initialized.

The animation rotates an object 15 degrees, then rotates it back to 0 degrees.

I want the animation to be stopped at frame zero, until a button tells it to play, then it will play to the next keyframe and stop, again. Basically this will appear as a toggled open/close animation.

It seems like a simple operation, but it is not.

How do I make the animation stop at the keyframes?

How do I get my button to tell the animation to play?

Thank you in advance.

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

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by JefferyWright · Jan 21, 2016 at 07:14 PM

Thanks,

Animation event = no function selected, and no functions available... where do I get these functions?

I know, I have to create a script, isn't it possible to do this without script in Unity? It is such a simple operation.

Is there a list of script functions that will stop a timeline from playing? Where are they located? How do you know what stops a timeline from playing?

Comment
Add comment · 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
0

Answer by Gabriel-Oliveira-Almeida · Jan 21, 2016 at 06:21 PM

I do not tested . But you can try to use , the animation event . By clicking above the keyframe you can put a animation event script. The script would have to stop the animation and continue only after a certain condition. OR split your animation in two and create a transition between them which corresponds to their condition.

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 JefferyWright · Jan 21, 2016 at 08:30 PM 0
Share

Okay, so I created a total of 4 Animations (which all had to be converted to 'Legacy' for some reason?):

(So the image file uploader does not work in this forum? Or is it just my browser? )

I attached them to my Wings object:

unity 02

When I run the player, the animation seems to be at the first animation, which is fine.

In the Animator, I have all the Animations on the grid:

unity 03

I cannot find any information about how to get a GUI button click to cause a Transition between the Animations... any ideas?

Thanks, again.

avatar image
0

Answer by tramelson · Sep 22, 2016 at 01:41 PM

Wondering the answer to this as well - if there is a way to play/stop in timeline in a script

Comment
Add comment · 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
0

Answer by Hanross · Jun 17, 2019 at 02:50 PM

it's very easy the object where animator is attached create script if no script is attached or if any script already attached from where animator is controlled then add this into file public void stopAnim() { animator.stop("clipname"); }

Comment
Add comment · 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

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

70 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

Related Questions

How to add Animation Events in the Timeline editor? 5 Answers

Animated GUI button 0 Answers

Is there an "IF" statement for "RectTransform"? 1 Answer

Recording animation into the timeline (and playing it back) at runtime 1 Answer

Toggle Button: hope it toggle once but it toggle many times 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