Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity 5.5 upgrade reset all particle system gravity values?

Discussion in 'General Graphics' started by Pawl, Mar 22, 2017.

  1. Pawl

    Pawl

    Joined:
    Jun 23, 2013
    Posts:
    113
    We recently upgraded from Unity 5.4 to 5.5.2p2 and it appears as though all of our gravity values in our particle systems have been reset to 0.

    I know the patch notes stated: "Particles: Gravity Modifier can now be a curve over time." but does this mean that all old gravity values have been reset? ie: Is this new gravity modifier variable replacing the old one and not defaulting to whatever it was set to?

    It seems as though we'll need to manually go through all of our scenes and set the gravity multiplier again per particle system.

    Thanks in advance.
     
  2. ifurkend

    ifurkend

    Joined:
    Sep 4, 2012
    Posts:
    350
    This should be no surprise that such thing happens whenever Shuriken gets a big upgrade. In my case, upgrading my particle system from 5.1 which does not have useAutoRandomSeed to 5.5 will be given a false value by default to the said function when the true value is expected in most circumstances.
     
  3. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    It should upgrade nicely, and preserve your settings. However, we have an issue logged, which sounds very similar to what you're describing here: https://issuetracker.unity3d.com/is...ystems-do-not-work-correctly-in-the-play-mode
    (I know it doesn't sound the same from reading it, but we've narrowed it down to some settings (including gravity) not upgrading correctly.)

    We are currently investigating the cause.

    If you want to upgrade right now, sadly you would have to manually reconfigure any affected systems, but hopefully we will get a fix for this at some point quite soon!

    Particle Systems should almost always upgrade nicely, but there are occasionally breaking changes made, which are called out in the Upgrade Guides. Gravity and Random Seeds should both upgrade without problems.

    This should only happen if you've set a custom randomSeed via script, on the system being upgraded. If that's not the case, then maybe you're encountering the same bug we are currently investigating.
     
    theANMATOR2b likes this.
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,226
  5. Pawl

    Pawl

    Joined:
    Jun 23, 2013
    Posts:
    113
    Hey all, thanks for the speedy replies. At the very least, it's nice to know this could be a known issue and not something we accidentally brought upon ourselves (I didn't find anything about this when searching the forums prior to making this post).

    After closer inspection (as karl suggested), it appears not all particle system gravity values were reset.

    We use a mixture of particles from the popular JMO asset packs (ie: https://www.assetstore.unity3d.com/en/#!/content/4010) as well as custom particles, both in prefabs and embedded in scenes.

    It's actually not very clear which ones were affected, but I'll list some specifics below (our project has hundreds of particle systems). We didn't notice this issue until a week after updating, so I couldn't really go back to 5.4 to verify what all things should have been set to, but these are some particulars:

    1) All of our particle systems in our Resources folder (that we spawn at runtime as prefabs) seem to have retained their correct values.
    2) "CFX3_SmokeColumn_Blue" (prefab embedded in a scene from JMO) has a gravity modifier of 0, when it should be 0.01.
    3) "Engine Puff" (prefab embedded in a scene) has a gravity modifier of -0.03 and seems fine (unaffected by the bug).
    4) This one is odd, but all "Fire" particle systems (prefab embedded in a scene) have a gravity modifier of -0.3, but it looks like it should be set to -0.01.

    It's worth noting that some of these particles may have been modified via scripts, as the JMO asset comes with a custom Unity Editor plugin to allow quickly modifying size/speed/duration/etc at the push of a button. Unfortunately I cannot say for sure which ones used this tool.

    I won't be able to provide a sample project any time soon (our proj is several GB and not a good "hello world" candidate). We're also relatively stuck on 5.5.2p2 for now since that's the latest version both XB1 and PS4 development support (we're trying to keep all platforms on the same Unity ver & repo).

    I think in the end, it affects less particle systems than we thought (perhaps only 20%) so we'll "fight forward" and manually spot check everything as best we can.
     
    richardkettlewell likes this.
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,226
    After further investigation we believe we have identified the issue. It seems that ParticleSystems are reverting to the prefab values and ignoring any overridden values in scenes for gravityScale and possibly a few other values. It looks like an internal serialization bug, probably due to using the same property name when we upgraded from floats to MinMaxCurves. The correct values should still be in the scene file so in theory if we get this fixed and a patch out then it should just go back to the correct values. That's just an educated guess at this point though, have to actually do the fix first ;)
     
    richardkettlewell likes this.
  7. Pawl

    Pawl

    Joined:
    Jun 23, 2013
    Posts:
    113
    Thanks for the update, karl!

    I had a suspicion that it could have also affected other properties, as one of our looping "water fountain" particle systems also appeared to have some sort of newly added "delay" where gaps would occur where no particles were spawning for a brief time window.

    EDIT: If you know exactly which _other_ values it could also be reverting, that would help us greatly so we can double check those in the inspector.

    Thanks again.
     
    Last edited: Mar 23, 2017
  8. ifurkend

    ifurkend

    Joined:
    Sep 4, 2012
    Posts:
    350
    Neither script nor extra component are attached to my particle system prefab when porting from 5.1 to 5.5.
     
  9. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,226
    Hi.
    This bug is proving quite tricky to fix, it's a really simple issue but internally a bit of a pain to detect.
    So here is a simple work around whilst we try and figure out a proper fix.

    First make a backup of any of the files you are going to change!

    Open your scene file(it needs to be text, not binary) and do a find and replace for InitialModule.gravityModifier, replace with InitialModule.gravityModifier.scalar.
    Save the scene, let it reload and it should be fixed.
    Like so:
    My fix.gif
     
    Pawl and richardkettlewell like this.