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

Particle size too small due to auto scaling #295

Closed
AlmarM36 opened this issue Feb 1, 2024 · 5 comments
Closed

Particle size too small due to auto scaling #295

AlmarM36 opened this issue Feb 1, 2024 · 5 comments
Assignees
Labels
bug Something isn't working released

Comments

@AlmarM36
Copy link

AlmarM36 commented Feb 1, 2024

Hi,

After updating to 4.6.2 from 3.3.14, all particle sizes are too small and I've been browsing the issues page for people with similar issues. Some of our particles are correctly sized due to the GameObject Transform having a certain scale. I understand some changes were made related to scaling, causing the scaling option to be disabled under certain Auto Scaling Modes.

I've noticed that setting Auto Scaling Mode to None will enable the Transform scale again, but manually setting this back to it's original value doesn't work, because after deserialization it will still reset the scale back to (1, 1, 1). I believe this is due to auto scaling being true (even with Auto Scaling Mode to None), but there doesn't seem to be an option to turn this off entirely. Is this intended?

Thanks!

@mob-sakai mob-sakai self-assigned this Feb 2, 2024
@mob-sakai
Copy link
Owner

Thank you for your reporting!

@mob-sakai
Copy link
Owner

Please try develop-295-disable-auto-scaling branch.

"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git?path=Packages/src#develop-295-disable-auto-scaling",

@mob-sakai mob-sakai added the bug Something isn't working label Feb 2, 2024
@AlmarM36
Copy link
Author

AlmarM36 commented Feb 2, 2024

Hi,

That allows me to change the scale again, so that's perfect. I did notice however that it still doesn't reproduce the exact same particle size as before the upgrade to version 4. It's somewhat smaller.

Original correct size

  • No version update
  • Transform.localScale = (25, 25, 25)
    original

After version update

  • Transform.localScale = (1, 1, 1)
  • UIParticle.Scale = 1
    after-update

After version update with UIParticle auto scale mode and original transform scale

  • Transform.localScale = (25, 25, 25)
  • UIParticle.Scale = 1
  • Auto Scale Mode = UIParticle
    image

I can fix this myself by copying the value that UIParticle sets to the transform scale automatically into UIParticle.Scale and resetting the transform scale back to it's original size with Auto Scale Mode set to None or UIParticle.

Manual fix

  • Transform.localScale = (25, 25, 25)
  • UIParticle.Scale = 4.971429 (automatically calculated by UIParticle after version update)
  • Auto Scale Mode = UIParticle
  • Latest v4 version
    image

Is this the intended behaviour?

On a side note, sometimes I get the following exception, but I'm unsure how to reproduce it:

NullReferenceException: Object reference not set to an instance of an object
Coffee.UIExtensions.UIParticleRenderer.GetWorldScale () (at Library/PackageCache/com.coffee.ui-particle@692c3e8798/Runtime/UIParticleRenderer.cs:522)
Coffee.UIExtensions.UIParticleRenderer.Set (Coffee.UIExtensions.UIParticle parent, UnityEngine.ParticleSystem ps, System.Boolean isTrail) (at Library/PackageCache/com.coffee.ui-particle@692c3e8798/Runtime/UIParticleRenderer.cs:252)
Coffee.UIExtensions.UIParticle.RefreshParticles (System.Collections.Generic.List`1[T] particles) (at Library/PackageCache/com.coffee.ui-particle@692c3e8798/Runtime/UIParticle.cs:475)
Coffee.UIExtensions.UIParticle.OnEnable () (at Library/PackageCache/com.coffee.ui-particle@692c3e8798/Runtime/UIParticle.cs:289)

Thanks!

mob-sakai added a commit that referenced this issue Apr 4, 2024
github-actions bot pushed a commit that referenced this issue Apr 4, 2024
## [4.6.3](v4.6.2...v4.6.3) (2024-04-04)

### Bug Fixes

* if only Trail Material is used, it will not be displayed ([2eff411](2eff411)), closes [#294](#294)
* if UIParticle's parents do not have Canvas, an exception is thrown in OnEnable ([bfc6045](bfc6045)), closes [#300](#300)
* particle size too small due to auto scaling ([2ec3748](2ec3748)), closes [#295](#295)
github-actions bot pushed a commit that referenced this issue Apr 4, 2024
## [4.6.3](v4.6.2...v4.6.3) (2024-04-04)

### Bug Fixes

* if only Trail Material is used, it will not be displayed ([2eff411](2eff411)), closes [#294](#294)
* if UIParticle's parents do not have Canvas, an exception is thrown in OnEnable ([bfc6045](bfc6045)), closes [#300](#300)
* particle size too small due to auto scaling ([2ec3748](2ec3748)), closes [#295](#295)
Copy link

github-actions bot commented Apr 4, 2024

🎉 This issue has been resolved in version 4.6.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue Apr 4, 2024
## [4.6.3](v4.6.2...v4.6.3) (2024-04-04)

### Bug Fixes

* if only Trail Material is used, it will not be displayed ([2eff411](2eff411)), closes [#294](#294)
* if the UIParticle parents do not have Canvas, an exception is thrown in OnEnable ([e82c833](e82c833)), closes [#300](#300)
* particle size too small due to auto scaling ([2ec3748](2ec3748)), closes [#295](#295)
Copy link

github-actions bot commented Apr 4, 2024

🎉 This issue has been resolved in version 4.6.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue Apr 4, 2024
github-actions bot pushed a commit that referenced this issue Apr 4, 2024
## [4.6.3](v4.6.2...v4.6.3) (2024-04-04)

### Bug Fixes

* if only Trail Material is used, it will not be displayed ([2eff411](2eff411)), closes [#294](#294)
* if the UIParticle parents do not have Canvas, an exception is thrown in OnEnable ([e82c833](e82c833)), closes [#300](#300)
* particle size too small due to auto scaling ([2ec3748](2ec3748)), closes [#295](#295)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants