Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 RCrusoe · Sep 15, 2017 at 12:06 AM · 2d animationdialog

Playing 2D animation over a Game Over dialog

I have a 2D animation I would like to play over my Game Over dialog, such that when the animation completes (and closes) the Game Over dialog is revealed.

I'm learning Unity, does anyone have a tutorial they can share with me, or advice on how to do it?

I've been able to get it working however the animation displays behind the dialog. I think I need to add a component but i'm not sure what one

thanks

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by guido-paglie · Sep 15, 2017 at 02:01 PM

Hi ! You can use AnimationEvents

https://docs.unity3d.com/Manual/animeditor-AnimationEvents.html

Basically you have to put an animation event on the animation window, on the selected animation clip. And there you can call a function of a script attached to that gameobjects.

So you can add at the end of the animation ( or maybe one frame before, sometimes unity has a bug and doesn't call an event on the last frame) and there call a function which reveals the GameOver dialog.

tutorial: https://www.youtube.com/watch?v=7G3B7l4GmYQ

Hope it helps, cheers !

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 RCrusoe · Sep 20, 2017 at 07:56 AM

Hi @guido-paglie thanks for the info, I've read the doco and watched the vid but am still struggling....

Fyi this is the animation ('Explosion') I'm trying to display over my dialog ('WinPanel'): https://www.assetstore.unity3d.com/en/#!/content/66932

(I'm using the Explosion prefab that comes with the asset.)

Rather than calling WinPanel from an event in Explosion, I'd just like to activate both at the same time from my script using: Explosion.SetActive(true) WinPanel.SetActive(true)

I've got this working but still can't get Explosion to display over WinPanel despite ordering them correctly in the Hierarchy, in the image below I show the Inspector for Explosion: alt text

In the next image I show the Inspector for Explosion > ExpAnimator. You can see it has an image assigned which does display over WinPanel, however its child images (Fire, Shrapnel, Smoke, Light) do not. These are the images that form the animation. alt text

Any ideas what I'm doing wrong? thanks


1.png (276.6 kB)
2.png (306.6 kB)
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 tmalhassan · Sep 20, 2017 at 08:16 AM 0
Share

Have you thought about making the animation a child of the panel?

avatar image RCrusoe tmalhassan · Sep 20, 2017 at 09:03 AM 0
Share

yeah tried that initially but no luck

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

71 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 avatar image

Related Questions

How to enable and disable a child collider in an animation 1 Answer

Running script/lines of code 1 Answer

how to call a class on click 1 Answer

Cant Get Dialogue Trigger Working 0 Answers

What is the best way to animate a 2D character? 2 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