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 /
This question was closed Jun 12, 2019 at 09:43 PM by NeoCroMagnon for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by NeoCroMagnon · Jun 11, 2019 at 10:43 AM · coroutineparticle systemloadlevelsetactive

Coroutine only starts when directly loading a scene from Unity editor.

Hi,

I have a character selection screen that displays a confirmation screen and when selecting, a coroutine is started, a burst of particles fly into the screen and the new level is loaded - this is to delay the loading of the level so the particles can fill the screen.

This all works as intended when I test it by directly loading the scene (character selection) on the Unity editor, however, if I'm doing a full test and I come from (Start Screen) I can do everything and the debug says it is registering everything, however the particles don't show up and the loading doesn't execute.

Also, the console doesn't display any errors.

I've tried everything (Stop coroutine, using a while(true)...) but can't figure out why it doesn't load. Code below:

IEnumerator DelayLoad() {

         heartExplosion[explosionNumber].gameObject.SetActive(true);
         yield return new WaitForSeconds(1);
         SceneManager.LoadScene(sceneName);
     
 }

 public void LoadEloise() {
     sceneName = "Eloise"; //selects the character and therefore which new scene will be loaded
     explosionNumber = 10; //selects the particle system that corresponds to that character
     StartCoroutine(DelayLoad());
 }

The UI button has LoadEloise() as the method that gets triggered when clicking on it.

This is a video showing what happens when testing from the screen the coroutine is hosted: https://www.youtube.com/watch?v=BQAgzJ-HJB4&feature=youtu.be

And this is what happens when reaching the same part from the previous scene: https://www.youtube.com/watch?v=WhEzi9Qjvg8&feature=youtu.be

Thanks a lot!

Comment
Add comment · Show 2
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 Magso · Jun 11, 2019 at 01:06 PM 0
Share

The fact that there's no errors seems like LoadEloise() isn't being called in the first place. Try testing On$$anonymous$$ouseDown() on a button to call LoadEloise()

avatar image NeoCroMagnon Magso · Jun 11, 2019 at 08:36 PM 0
Share

Thanks $$anonymous$$agso, it does work when testing from the scene where the coroutine is hosted, but not when reaching that same part starting from the previous scene.

I have made two videos showing what it looks like when starting from the Character Select screen and when starting from the previous one.

Character select screen: https://www.youtube.com/watch?v=BQAgzJ-HJB4&feature=youtu.be

When starting from the previous screen (start screen) https://www.youtube.com/watch?v=WhEzi9Qjvg8&feature=youtu.be

1 Reply

  • Sort: 
avatar image
0

Answer by NeoCroMagnon · Jun 12, 2019 at 09:42 PM

Managed to find the issue, it had nothing to do with that part of the code but with a line coming from a library that I was using on the previous scene and forgot about and which changed the time settings of the project.

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

Follow this Question

Answers Answers and Comments

123 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 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

Running Coroutines Between Levels 4 Answers

physics.OverlapSphere colliders 1 Answer

Deactivate GameObject after Coroutine ended 1 Answer

Particles don't follow the transform of the parent gameobject? 0 Answers

Problem with Object Pooling and Deactivating Objects.!! 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