Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeline Signal Emitter can't stop a UIParticle using ParticleSystem.Stop() #341

Open
CharlieScarver opened this issue Nov 8, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@CharlieScarver
Copy link

Describe the bug
A Signal Emitter from the timeline to Stop any UIParticles using the ParticleSystem.Stop() method will not work. Only a Signal using UIParticle.Stop() will work (but note that this will also stop any other particle systems nested under that UIParticle object, if there are any). I believe this is probably a bug.

Sample Scene, Timeline, Signal and Particle: Assets.zip

To Reproduce
Steps to reproduce the behavior:
0. Create a new Unity Project and add the UIParticle package via the git link and the TextMeshPro package

  1. Create a new Game Object "Director" and add a PlayableDirector component to it
  2. Create a new TimelineAsset for that object and assign it to the Playable field
  3. Create a new UI Canvas
  4. Create a new GameObject "UI Particle" under the Canvas and add the UIParticle component to it
  5. Create a new GameObject "Particles" under the UIParticle object and add a ParticleSystem component to it
  6. Disable the Particles object
  7. Click on the Director object and open the timeline editor to edit the timeline asset
  8. In the Timeline editor add a new Control Track and drag the Particles object on it (or just drag the object on the timeline)
  9. Create a new Signal track and drag the Particles object as the Signal Receiver object on the left side
  10. Right click in the middle of the control track (should be around 300 frames so middle would be frame 150) and choose "Add Signal Emitter"
  11. Create a new Signal Asset called "Stop Particles" and when prompted add Signal Receiver components to the Particles object
  12. Click on the Signal Emitter on the timeline and add a new Signal Reaction in the Signal Receiver segment in the inspector window on the right
  13. Choose "Editor And Runtime" and "ParticleSystem > Stop()" method
  14. Create a new Button under the UI Canvas and add an OnClick event to it that calls the "PlayableDirector > Play()" method of the Director object
  15. Save the scene
  16. If you now play the game and click the button to trigger the timeline, you will notice that the particle system doesn't stop emitting in the middle of the timeline duration but instead keeps playing until the end and then just disappears when the Particles object is reverted to its disabled state.
  17. If you then stop the game, go to the Signal Emitter on the timeline and add a new reaction that targets the "UI Particle" object and calls "UIParticle > Stop()" method, save and play again, you will notice that the particle system stops emitting in the middle of the timeline.

Expected behavior
Since the "Usage" section of the UIParticle readme states that particles can be controlled using either methods (ParticleSystem > Stop() and UIParticle > Stop()) I believe this is probably a bug. Took me quite a while to realize why my ParticleSystems were not stopping 😅

Screenshots
Sample Scene, Timeline, Signal and Particle: Assets.zip

Environment (please complete the following information):

  • Version: 4.10.2
  • Platform: Target Platform: Windows; Architecture: Intel 64-bit
  • Unity version: 2022.3.45f1]
  • Build options: Scripting Backend: Mono; API Compatibility Level: .NET Standard 2.1
@CharlieScarver CharlieScarver added the bug Something isn't working label Nov 8, 2024
@mob-sakai
Copy link
Owner

Thank you for your reporting!

@mob-sakai
Copy link
Owner

The issue is reproduced on my environment.

@mob-sakai
Copy link
Owner

Turning off Control Track > Advanced > Control Particle System resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants