Loading vs Instantiating Questions
Posted: Sat Apr 24, 2021 9:09 pm
Hi Joel,
I have some questions about Loading vs Instantiating. I am using Unity 2020.3.5 LTS.
1) I’ve noticed that the Start() function will NOT run when an object is loaded but it WILL run when it is instantiated – Why is this and what is the recommended workaround if I need Start() to run when an object is loaded?
2) If I make a prefab particle system and then instantiate the prefab it works without error messages. If I Save and the Load the same prefab I will get the following error messages:
• Setting the duration while system is still playing is not supported. Please wait until the system has stopped and all particles have expired or call Stop with ParticleSystemStopBehavior.StopEmittingAndClear to completely stop the system.
UnityEngine.ParticleSystem/MainModule:set_duration (single)
• Setting the random seed while system is still playing is not supported. Please wait until the system has stopped and all particles have expired or call Stop with ParticleSystemStopBehavior.StopEmittingAndClear to completely stop the system.
What is the best way to solve this problem?
3) Besides those two specific questions – what is best way to think about loading vs instantiating? Is there anything else I need to look out for?
Thanks,
Larry
I have some questions about Loading vs Instantiating. I am using Unity 2020.3.5 LTS.
1) I’ve noticed that the Start() function will NOT run when an object is loaded but it WILL run when it is instantiated – Why is this and what is the recommended workaround if I need Start() to run when an object is loaded?
2) If I make a prefab particle system and then instantiate the prefab it works without error messages. If I Save and the Load the same prefab I will get the following error messages:
• Setting the duration while system is still playing is not supported. Please wait until the system has stopped and all particles have expired or call Stop with ParticleSystemStopBehavior.StopEmittingAndClear to completely stop the system.
UnityEngine.ParticleSystem/MainModule:set_duration (single)
• Setting the random seed while system is still playing is not supported. Please wait until the system has stopped and all particles have expired or call Stop with ParticleSystemStopBehavior.StopEmittingAndClear to completely stop the system.
What is the best way to solve this problem?
3) Besides those two specific questions – what is best way to think about loading vs instantiating? Is there anything else I need to look out for?
Thanks,
Larry