The default 3D Renderers draw stuff according to Z depth - distance from camera.
SpriteRenderers draw according to their Sorting Layer and Sorting Depth properties
UI Canvas Renderers draw in linear transform sequence, like a stack of papers
If you find that you need to mix and match items using these different ways of rendering, and have them appear in ways they are not initially designed for, you need to:
identify what you are using
search online for the combination of things you are doing and how to to achieve what you want.
Well, I realized that these are different types of objects. But I want to do all of them UI. But the only thing I found was to simply translate the 3D object into PNG and connect it to the image. But I have a custom object with several animations and a texture and it doesn’t work for me. Someone says just change canvas to world space. But it doesn’t change anything for me at all.
I have a similar problem. I have a worldSpace canvas with an image on it behind a 3D object, but it appears in front of the object, unless that object is very close to the camera. In other words, the camera seems to think the canvas is closer than it actually is. What is even stranger is that I have a similar canvas with the same image and material next to it, and it works just fine. Also, the problem only happens in the game view. The scene view is rendered exactly as I want.
After playing around a bit, I’ve realized that when I do right click > UI > Image outside a canvas, a canvas object is created automatically before creating the image inside the canvas, but this problem arises. But if I first create the canvas, then create the image in the canvas, it works correctly.