Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Thanks for this, it helps me a lot.

I have a question: I set my Canvas Scaler of my UI to Scale with screen size, at ref res 64x64. But it seems it does not match the 64x64 resolution. Witch make sense I guess: the UI is rendered in front of the main camera, not on the 64x64texture. Is there a way to render it in the target texture?

How do you handle this?

On the canvas, I have it set to "Screen Space - Camera" in pixel perfect mode with the Render Camera set to my main camera (the one rendering to texture).

On the canvas scaler settings, "UI Scale Mode" is set to "Constant Pixel Size".

This should cause your UI to not only stop scaling with the screen size, but also to render to the camera itself, therefore rendering to the target texture.

Thanks, it looks better now!

Although now my UI seems to not follow exactly the position of the camera, always 1-2 pixels behind:


I'm not entirely sure about that myself.  I'd have to say to check your scripts as well as your object hierarchy and canvas settings to see if somehow your canvas is being moved by something else.

I couldn't fix it, but the problem doesn't show up in standalone builds, so I'll leave it like that for now. Again thank you for your help !