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
- Create 2 Canvases with CanvasScaler UIScaleMode = ScaleWithScreenSize and with different ReferenceResolution values
- Create a GameObject under Canvas1 with following components: UIParticle, ParticleSystem with a proper trail component
- Change GameObjects parent to Canvas2 without changing local scale values during runtime.
- Trail will be played with an offset
- 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 ๐ฆ๐