- Home /
How do you force a particle system to play all the time in the editor, not just when it is selected?
I need certain particle systems to play all the time while I am editing a scene, as opposed to playing only when they are selected. How should this be achieved?
After a bit more experimentation, it appears the the Unity Editor doesn't even call Update() on objects unless they are selected. It looks ridiculous to have all the particle systems in my scene paused - especially when ParticleEmitter.Simulate() is broken and the systems don't even get a chance to warm up...
I think the Unity Editor calls Update when it's about to draw a new frame, such as when something changed in the scene.
Answer by Tortuap · Jul 18, 2014 at 12:32 PM
It is now possible, as of version 4.3 at least.
Select a Particle System. Open the editor in its own floating window. Then in the upper right corner of that window, click the lock button. The window is locked on the particle system and the particle system will play whatever your selection becomes.
If you need to do that with multiple particle system, it's a little bit tricky. Select another particle system you want to play. From the previous editor floating window, click the most upper right button (the little menu that all floating windows have, above the lock button) choose Add tab -> Inspector.
Repeat to add other system to be played.
This is clearly a bug exploit because if you close the locked editor windows, the particle system will continue to play :-)
It is possible to select multiple particle systems at once, in one inspector, and then locking it. This is useful for testing PS that start at the same time, or to have many PS running at the same time without having more than two inspectors open.
Answer by Joshua · May 27, 2011 at 03:45 PM
It's not possible because the built-in script for particle systems is apperently written in a way where it will execute in edit mode if it's selected. Since you cannot change how the script works, you cannot change that. You can also not 'fake' it being selected.
What you say about Update() only being called on selected objects is nonsense. Update is called, if I remember correctly, when focus is on the scene-view every frame and every event, and when focus is on an other window every repaint and every event.
Answer by Jake-L · Feb 17, 2011 at 09:40 AM
Sorry, but this isn't possible with the buildin particle system!
Answer by Ashkan_gc · Mar 13, 2011 at 08:28 PM
there is only one way to execute your own scripts in edit mode for your object. you should add ExecuteInEditMode attribute to your script, but unfortunately nothing can not be done for particle systems. i don't know they might be executed in edit mode when you have a script with this attribute attached or at least a script with this attribute that calls particle related stuff.
Nope, they're unfortunately not. This seems like such a simple issue, I'm honestly surprised no one has an answer.
Well, I'm honestly suprprised that two right answers and some good suggestions what you might want to try is not enough for you...
Jake - I didn't mean that as a denigration of everyone's suggestions, but rather as genuine surprise that such a see$$anonymous$$gly straightforward issue doesn't have a simple solution. I have tried all the suggestions, and none of them work - but I am also not absolutely convinced that this is impossible. If anyone has other suggestions, I am most interested
Answer by yeneZan · Sep 18, 2016 at 06:16 PM
@Aubrey Falconer It's maybe too late, but I had the same trouble and came up with a solution as below.
time = GUILayout.HorizontalSlider(time, 0, ps.startLifetime * ps.duration);
if(GUI.changed)
{
ps.time = time; //set value and play straightly
//ps.Simulate(time, true, true); //usual api
}
Withought select the ParticleSystem, multiplay is possible as well.
Will this could help another.
Your answer
Follow this Question
Related Questions
How to play a particle system from the editor without selecting it 1 Answer
Change Size over Lifetime for Particle System? 1 Answer
When and how to take a screenshot of a particle system from the editor? 0 Answers
Track passing time in EditorScript 1 Answer
in-editor cloning of game objects 1 Answer