Page 1 of 1

Setting the duration while system is still playing is not supported.

Posted: Tue Jan 26, 2021 12:15 pm
by marcjammy
Hi - when loading objects with particle systems included in their children, I'm receiving this error.

Any tips on how to resolve this?

Code: Select all

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.MainModule:set_duration(Single)
ES3Types.ES3Type_MainModule:ReadInto(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MainModule.cs:80)
ES3Reader:ReadObject(Object, ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:239)
ES3Reader:ReadInto(Object, ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:292)
ES3Types.ES3Type_ParticleSystem:ReadComponent(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_ParticleSystem.cs:95)
ES3Types.ES3ComponentType:ReadObject(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ComponentType.cs:97)
ES3Types.ES3ObjectType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Types.ES3Type_GameObject:ReadComponents(ES3Reader, GameObject) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:211)
ES3Types.ES3Type_GameObject:ReadObject(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:160)
ES3Types.ES3ObjectType:ReadInto(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:77)
ES3Types.ES3Type_GameObject:ReadObject(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:124)
ES3Types.ES3ObjectType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Reader:ReadObject(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader:Read(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Types.ES3CollectionType:ReadICollection(ES3Reader, ICollection`1, ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs:52)
ES3Types.ES3ArrayType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs:36)
ES3Reader:Read(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:274)
ES3Reader:Read() (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:126)
ES3Types.ES3Type_GameObject:ReadObject(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:157)
ES3Types.ES3ObjectType:ReadInto(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:77)
ES3Types.ES3Type_GameObject:ReadObject(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:124)
ES3Types.ES3ObjectType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Reader:ReadObject(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader:Read(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Types.ES3CollectionType:ReadICollection(ES3Reader, ICollection`1, ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs:52)
ES3Types.ES3ArrayType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs:36)
ES3Reader:Read(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:274)
ES3Reader:Read() (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:126)
ES3Types.ES3Type_GameObject:ReadObject(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:157)
ES3Types.ES3ObjectType:ReadInto(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:77)
ES3Types.ES3Type_GameObject:ReadObject(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:124)
ES3Types.ES3ObjectType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Reader:ReadObject(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader:Read(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Types.ES3CollectionType:ReadICollection(ES3Reader, ICollection`1, ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs:52)
ES3Types.ES3ArrayType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs:36)
ES3Reader:Read(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:274)
ES3Reader:Read() (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:126)
ES3Types.ES3Type_GameObject:ReadObject(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:157)
ES3Types.ES3ObjectType:ReadInto(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:77)
ES3Types.ES3Type_GameObject:ReadObject(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:124)
ES3Types.ES3ObjectType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Reader:ReadObject(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader:Read(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Types.ES3CollectionType:ReadICollection(ES3Reader, ICollection`1, ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs:52)
ES3Types.ES3ArrayType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs:36)
ES3Reader:Read(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:274)
ES3Reader:Read() (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:126)
ES3Types.ES3Type_GameObject:ReadObject(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:157)
ES3Types.ES3ObjectType:ReadInto(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:77)
ES3Types.ES3Type_GameObject:ReadObject(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:124)
ES3Types.ES3ObjectType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Reader:ReadObject(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader:Read(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Types.ES3CollectionType:ReadICollection(ES3Reader, ICollection`1, ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs:52)
ES3Types.ES3ArrayType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs:36)
ES3Reader:Read(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:274)
ES3Reader:Read() (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:126)
ES3Types.ES3Type_GameObject:ReadObject(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:157)
ES3Types.ES3ObjectType:ReadInto(ES3Reader, Object) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:77)
ES3Types.ES3Type_GameObject:ReadObject(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:124)
ES3Types.ES3ObjectType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Reader:ReadObject(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader:Read(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Types.ES3ListType:Read(ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ListType.cs:64)
ES3Reader:Read(ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:274)
ES3Reader:Read(String, List`1) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:212)
ES3:Load(String, List`1, ES3Settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:419)
ES3:Load(String, String, List`1) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:391)
LoadMap:LoadAMap(String) (at Assets/Scripts/LoadMap.cs:46)
LoadMapButton:LoadMapButtonPress() (at Assets/Scripts/LoadMapButton.cs:10)
UnityEngine.EventSystems.Even

Re: Setting the duration while system is still playing is not supported.

Posted: Tue Jan 26, 2021 12:31 pm
by Joel
Hi there,

As the error suggests, you would need to stop the particle system before loading so that it's not setting the duration while the particle system is live.

All the best,
Joel

Re: Setting the duration while system is still playing is not supported.

Posted: Tue Jan 26, 2021 12:45 pm
by marcjammy
So, On Save call Stop() on all particle systems before saving?

So that On Load there shouldn't be any particle systems running?

Edit: That doesn't work.

So I need to iterate through a list held in a save file, turn off all the particle systems, before loading it?

Re: Setting the duration while system is still playing is not supported.

Posted: Tue Jan 26, 2021 4:39 pm
by Joel
Hi there,

Just to check, when you call Stop are you specifying the withChildren parameter as 'true' and the stopBehaviour as StopEmittingAndClear? Otherwise it won't actually stop the particle system, it will just stop the emission of particles.

All the best,
Joel

Re: Setting the duration while system is still playing is not supported.

Posted: Wed Jan 27, 2021 10:17 am
by marcjammy
Yes:

Code: Select all

 if (gobject.GetComponentsInChildren<ParticleSystem>().Length != 0)
            {
                ParticleSystem[] partsystems = gobject.GetComponentsInChildren<ParticleSystem>();

                foreach (ParticleSystem system in partsystems)
                {
                    system.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);                    
                }
            }

            //Then go ahead and save the object.
And then when I load the object I get the error detailed above.

Re: Setting the duration while system is still playing is not supported.

Posted: Wed Jan 27, 2021 10:39 am
by Joel
Would you be able to send me a new project with a basic scene which replicates this? If Unity is throwing the error despite the particle systems being stopped then this suggests a bug at their end which will need to be reported.

If you could also let me know the version of Unity you're using, this will help me isolate it.

All the best,
Joel

Re: Setting the duration while system is still playing is not supported.

Posted: Wed Jan 27, 2021 11:21 am
by marcjammy
Sorry I'm on a deadline with this project so cannot spend time setting up a new project - if I destroy the particle system instead it works and I can workaround this issue.