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
5
Question by Gabriel · Nov 18, 2010 at 09:58 PM · animationiphonescene-loadinginvoke

Animation not playing when returning to a previous loaded scene

Hey guys, hope you can help me

I have a scene which is loaded right after the game starts with this piece of code in an Awake function. The second line already starts the animation.

    yield Application.LoadLevelAsync("MenuScene");
    Menu.instance.Init();

And in this scene i load the proper "game Scene", and to return to this menu i use this code

public function ToMenuScene() { yield Application.LoadLevelAsync("LoadingScene");

 var _loadLevel : AsyncOperation;
 _loadLevel = Application.LoadLevelAsync("MenuScene");
 LoadingScene.instance.Init(_loadLevel);

 yield _loadLevel;

 Menu.instance.Init();

}

Since internally i use Invokes to call the proper animations, i thought that could be it, but with multiple debugs i can see that all functions are called all the way to the end, except that on the second time i load the scene the menu doesn't perform any animation(it uses the animation component in unity, not a custom one).

If it helps, the animation is a multi-layered animation, but no layer is playing. Target platform is iOS.

Here's the code for the animation, animation names are in portuguese, just ignore. Both debugs show in the console

function Init() {

 Debug.Log("init animation");
 animationComponent["Armor_Gira"].layer = 1;
 animationComponent["Armor_Gira"].wrapMode = WrapMode.Loop;

 animationComponent["Escudos_Gira"].layer = 2;
 animationComponent["Escudos_Gira"].wrapMode = WrapMode.Loop;

 animationComponent["GarraIdle1"].layer = 3;
 animationComponent["GarraIdle1"].wrapMode = WrapMode.Clamp;
 animationComponent["GarraIdle2"].layer = 3;
 animationComponent["GarraIdle2"].wrapMode = WrapMode.Clamp;
 animationComponent["GarraIdle3"].layer = 3;
 animationComponent["GarraIdle3"].wrapMode = WrapMode.Clamp;

 animationComponent["MenuBox1_Build"].layer = 4;
 animationComponent["MenuBox1_Build"].wrapMode = WrapMode.ClampForever;

 animationComponent["MenuBox1_Unbuild"].layer = 4;
 animationComponent["MenuBox1_Build"].wrapMode = WrapMode.ClampForever;


 animationComponent["MenuBox2_Build"].layer = 5;
 animationComponent["MenuBox2_Build"].wrapMode = WrapMode.ClampForever;

 animationComponent["MenuBox2_Unbuild"].layer = 5;
 animationComponent["MenuBox2_Build"].wrapMode = WrapMode.ClampForever;

 animationComponent["Orbit"].layer = 6;
 animationComponent["Orbit"].wrapMode = WrapMode.Loop;

 animationComponent["Camera_Anim1"].layer = 7;
 animationComponent["Camera_Anim1"].wrapMode = WrapMode.Clamp;

 animationComponent["Camera_Anim2"].layer = 7;
 animationComponent["Camera_Anim2"].wrapMode = WrapMode.Clamp;

 animationComponent["Camera_Anim3"].layer = 7;
 animationComponent["Camera_Anim3"].wrapMode = WrapMode.Clamp;

 animationComponent.Play("Orbit");
 IdleAnimationCoroutine();

 Debug.Log("init end");

}

Any of you guys had this problem before? Any help or suggestion is deeply appreciated

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
28

Answer by Unity_gamer · Aug 09, 2012 at 04:15 PM

If you are using Time.timescale value to pause the Game just make sure that you are turning it back to 1.!!

Comment
Add comment · Show 7 · 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 albertofdb · Sep 18, 2014 at 11:11 PM 2
Share

Thank you very much guy, You've solved my problem

avatar image Kabeza · Mar 30, 2016 at 01:47 AM 1
Share

thanks a lot!

avatar image · Oct 20, 2018 at 02:49 AM 0
Share

God bless you dude!

avatar image FantacyfilmsUS · Jul 18, 2019 at 06:52 AM 0
Share

I'm embarrassed to say after 2 years, this has been my issue all along....

avatar image Roshaanpro · May 04, 2020 at 09:56 AM 0
Share

I was having trouble with my Gif Animator Plugin! I did not think this would be the issue, but it turned out to be! I've been trying to debug for a while and glad I found this.

Thanks!

Show more comments
avatar image
12

Answer by burnill · Apr 06, 2012 at 05:58 PM

I had a problem that when I quit from my level to the menu the start up animation in the menu wouldn't play. It turns out I paused the game and then clicked Quit to menu but never "Unpaused" the game so the animations are frozen. Perhaps that may be your problem?

Comment
Add comment · Show 3 · 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 albertofdb · Sep 18, 2014 at 11:10 PM 0
Share

Thank you very much guy, You've solved my problem

avatar image shengen74 · May 19, 2020 at 04:52 PM 0
Share

Thanks !!!

avatar image JimKeen · Dec 15, 2020 at 02:45 AM 0
Share

Yes! Omg, It would have taken me forever to notice this. It was exactly this for me. Thank you!

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

11 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

Related Questions

Using the "Fade"-Class crashes unity-iphone build... 1 Answer

Unity Invoke method delay factor vary device to device 1 Answer

How to achieve best fps for Animating - Built-in Unity animation or coded through Javascript? 1 Answer

AnimationEvent not reliably triggerd on iPhone 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 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