Aspect ratio problems with particle systems on canvas

Hi all, I have a very very annoying problem which I have been trying to fix forever but I just cannot find a way to fix it

So to explain what I have going, I have a bar which shoes how much of your power up you have left, this has its origin in the far left and it scaled along the x axis to show how much is left. Parented to the bar (on scale 1) on the right side is a particle system, this then always stays on the edge of the bad as it scales.

I hade to change this to a world space canvas otherwise the particle system just wouldn’t position properly no matter what I tried.

This world space canvas also has a vertical boost gauge on the left side of it, as that used a particle system too

Now here’s the problem, when you change the aspect ratio the world space canvas does not adjust, hence things overlap and go out the edge

I’ve tried using the aspects ratio fitter but then the particle systems break again

Does anybody know any way you fix it? So that I can have particle systems on an canvas which properly resizes

Don’t worry guys, found a solution, very messy one where I calculated linear lines of regression and made the code use them to position stuff but works nevertheless

what your solution?

Essentially what I did was I went to 5 different aspect ratios. At each one I noted down the aspect ratio (as a single number. 16:9 was something like 1.7…) then moved the gauge to the right until it looked how it originally did and noted down the position. I tried plotting these values against each other and found they had a linear relation ship, so I used some A Level maths and calculated a linear line of regression from it. I put this formula in the code, using it it would calculate the desired position based on the aspect ratio

from Scaling the particle system in UI? :

“Ensure that the Scaling Mode in the main particle settings is set to Hierarchy.
Docs with full explanation for it are here: Unity - Manual: Particle System Main module”