Search Issue Tracker
By Design
Votes
0
Found in
2020.3.45f1
2021.3.18f1
2022.2.5f1
2023.1.0b2
Issue ID
UUM-27706
Regression
No
Two Particle systems are not synchronized when the second Particle System starts from the current frame of the first one
How to reproduce:
1. Open the user-attached project “FireParticleSystemBug”
2. Open the “FireCantIdentical” scene
3. Enter the Play Mode
4. Observe the Particle Systems after the second one is instantiated
Expected result: Both Particle Systems are synchronized
Actual result: Particle Systems behave differently despite the second Particle system starting from the current frame of the first Particle system
Reproducible with: 2020.3.45f1, 2021.3.18f1, 2022.2.5f1, 2023.1.0b2
Reproducible on: Windows 11 Pro
Note: Also reproducible in Player
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- NavMesh Surface is baked too high above the ground, making the NavMesh Agents hover above the ground when the HeightMesh is not built
- [Android] Crash on ProcessDynamicBatchGeometryJob with OpenGL or on DrawSharedGeometryJobs with Vulkan
- VFX Graph Memory leak when calling the ClearPropertyBinders and AddRemoveVFXProperty
- Entering "Configure Avatar" inside the Inspector locks it
- [Render Graph Viewer] Resource list icons cropped and in inconsistent positions
Resolution Note:
I've had a look at this, so I can now give a better answer than I could on the forums.
The reason they are different is because fire1 is siimulated via the built-in per-frame system, and fire2 is fast-forwarded to the time of fire1 via the Simulate API method.
The first method advances the simulation by the timestep each frame (Time.deltaTime), whereas the second method (SImulate) advances the simulation by a fixed timestep. This difference causes the divergence.
If you want to set the state of fire2 to exactly match fire1, call GetPlaybackState on fire1, and then SetPlaybackState on fire2. This copies the entire state exactly from one system to another. (you'll also need to call Get/SetParticles to copy the actual particles over too, and if you use trails, there is another API to copy trails data over too.. Get/SetTrailsData i think)
Alternatively, to keep them in sync, you could simulate Fire1 yourself in the script too. So, instead of using the Play/Stop API, use Simulate for fire1. You'll need to ensure the fixedTimestep param is true, which may make the playback not entirely smooth.