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 Databases · Sep 25, 2014 at 11:59 AM · animationpause

Pause the game after animation is completed

Hello, everyone

(I'm using the new Unity UI system)

I have a little problem that i'm confused about how to actually get it working using the right code

I have a pause button attached to my scene, when i click the pause button it shows a pause menu that has an animation, now if i use Time.timeScale = 0 the animation won't complete, so how i tell my scene to be paused after that animation has completed?

Any help i greatly appreciated

Thank you for your time.

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
0

Answer by N1warhead · Sep 25, 2014 at 12:02 PM

It would be nice to see some code... However, I believe this will answer your question here. This is in Javascript AKA (Unityscript)

yield WaitForSeconds (animation["YourAnimationName"].length);

Hope that answered your question.

Comment
Add comment · Show 2 · 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 Databases · Sep 25, 2014 at 06:05 PM 0
Share

good idea, but actually i think it won't work, i have tried it IEnumerator function is not accessible by On Click()

Actually there is not much code, here it is:

  Animator pausedDialog;

Public void menu() {

    // this is to start the animation when pause_button is clicked
    pausedDialog.enable = true;
    
    pausedDialog.SetBool("isActive", false);

}

so, paused_Dialog object is assigned to pausedDialog and pause_button by default has On Click () function, using the "+" sign i did add the script and choose the menu function to play the animation when the button is clicked, everything works fine, but when i want the game to be paused using Time.timeScale = 0, i'm not able to get the animation working.

I guess you can understand the above script if you are familiar with the new Unity UI system

Thank you for your time.

avatar image N1warhead · Sep 29, 2014 at 09:41 PM 0
Share

Sorry for not getting back to you sooner.

I haven't used Unitys new UI System and don't plan on touching it until I see actual positive results with it, don't want to change my entire game until I know it's better and easier to use lol.

I'm assu$$anonymous$$g you're using C# then? Because with Unityscript you shouldn't need an IENumerator for a co-routine. At least, I never used one when I was using Unityscript, it would just call my co-routine.

I've truthfully never made a Paused function yet. But from what I can see is try to make your paused Dialog into an if statement..

Such as if(time

I don't think that is properly created, just made it off the top of my head, but maybe you can work around it with that?

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

26 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

Related Questions

Animation Problems 1 Answer

Pause Animation Clip wiothout rewinding 0 Answers

Pause an animation with a button 1 Answer

Can I make animations snap to a frame? 1 Answer

pause animation when two objects is colliding and resume when they're not colliding without rigid body? 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