Using trail renderer in UI

Hey everyone,

I’m working on a platformer with some collectible items.
I have a counter on my HUD displaying how many items the player has collected.

What i’m doing is when the player collects a collectible item, i create an Image component on my hud where the collectible was in the world(using Camera.WorldToScreenPoint) and tween it to the collectible counter to then increment it.

But i’m trying to add a trail effect when this image is tweening to the counter.
Unfortunately, the trail isn’t showing when adding a trail renderer component to the image component, the canvas is set as screenspace overlay.

Is there a way to do this ? Maybe i need to change some canvas settings ?

Thanks ^^

I’d like to know how to do this too.

I used a workaround to do this since i didn’t manage to use the trail renderer on the UI. The trick was to make a game object with a trail renderer in the scene (outside the UI canvas).

Then i displayed the collectible item on the HUD (in the UI canvas) and moved it to where i wanted it to be and then, moved the game object containing the trail renderer, converting the collectible position in the canvas to the world position.

It works quite well for what i needed.