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

Switched from regular Particle Systems, now Play() resets the simulation and I have no way to determine whether it's already playing or not #355

Open
PortgateStudios opened this issue Feb 12, 2025 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@PortgateStudios
Copy link

Hi guys!

I'm using a particle system to highlight a card in my game. It has 3 distinct coloured highlight states or turned off entirely.

  • So if it has to be highlighted, I set the color and called Play().
  • If it doesn't have to be highlighted, I called Stop().

This way:

  • it slowly started and stopped,
  • while seamlessly "faded" between states/colours: e.g. when the highlight state changed from "Usable" to "Forbidden".
    • There was no issue with always calling Play() when changing the highlight state/colour, even if it was already in some other highlighted state -> thus playing.
    • Because Unity didn't care about the particle system already being played, it just ignored my unnecessary Play() request I guess.

But now I switched to this package, and here it seems that Play() resets the simulation.

  • So when I switch from blue highlight to green, all particles get erased and the system starts over slowly. So no more seamless transition.

I tried to fix this by only calling Play() if the particle system isn't playing. But after hours of trying I couldn't get it to work.

  • I could only find IsPaused but it's false in the beginning, when the system is stopped. So it really means just "being paused" and not "is not playing".
  • Checking isPlaying on the underlying particle system didn't work either, because I guess it's never really playing. It's just used as a template and for Simulation by the package's UIParticles, right?

How could I make my highlight system work once again? Should I fork the package and disable somehow the auto-reset in Play()? Or how could I detemine whether it's already playing or not?

Thanks in advance! :)

@PortgateStudios PortgateStudios added the question Further information is requested label Feb 12, 2025
@mob-sakai
Copy link
Owner

Thank you for your reporting!
I would like to know more about this issue.
Could you please attach a minimal project (included Assets, Packages and ProjectSettings directories) that reproduces the issue?
Of course, you don't need to include any secret assets from your project. Feel free to use free assets instead.

repos

@PortgateStudios
Copy link
Author

PortgateStudios commented Feb 12, 2025

Sure, here it is:

ProjectSettings.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants