Skip to content

Commit

Permalink
fix: trail incorrect offset
Browse files Browse the repository at this point in the history
close #335
  • Loading branch information
fghj0810 authored and mob-sakai committed Nov 1, 2024
1 parent c1e3d68 commit afe00a1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Packages/src/Runtime/UIParticleRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,12 @@ private Matrix4x4 GetWorldMatrix(Vector3 psPos, Vector3 scale)
return Matrix4x4.Translate(psPos)
* Matrix4x4.Scale(scale);
case ParticleSystemSimulationSpace.World:
if (_isTrail)
{
return Matrix4x4.Translate(psPos)
* Matrix4x4.Scale(scale)
* Matrix4x4.Translate(-psPos);
}
return Matrix4x4.Scale(scale);
case ParticleSystemSimulationSpace.Custom:
return Matrix4x4.Translate(_particleSystem.main.customSimulationSpace.position.GetScaled(scale))
Expand Down

0 comments on commit afe00a1

Please sign in to comment.