mob-sakai/ParticleEffectForUGUI

ParticleSystem Trails gain Offset on parent canvas change

Closed this issue ยท 1 comments

Describe the bug
When a GameObject's transform parent is changed to another canvas with different CanvasScaler properties, ParticleSystems using Trail component have visual issue, such as trail being played at an offset position. We believe this is caused due to OnTransformParentChanged being overridden without its base method.

To Reproduce

  1. Create 2 Canvases with CanvasScaler UIScaleMode = ScaleWithScreenSize and with different ReferenceResolution values
  2. Create a GameObject under Canvas1 with following components: UIParticle, ParticleSystem with a proper trail component
  3. Change GameObjects parent to Canvas2 without changing local scale values during runtime.
  4. Trail will be played with an offset
  5. To fix during runtime simply disable and enable GameObject

Expected behavior
OnTransformParentChanged should be called to properly cache right canvas

Environment (please complete the following information):

  • Version [e.g. 4.9.0]
  • Platform: [Editor(Windows/Mac), Standalone(iOS, Android)]
  • Unity version: [2021.3.38f1 & 2022.3.3.37f1]

Additional context
Removing OnTransformParentChanged overridden method on UIParticle.cs fixed the issue for us.

๐ŸŽ‰ This issue has been resolved in version 4.9.1 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€