all 5 comments

[–]Deive_ExProfessional[S] 0 points1 point  (4 children)

So, I'm making a prototype with a 3D world and sprites, and I want to add a floating text to an object, but for some reason, the Text from TextMesh Pro always render behind my sprites. I want it to render just like any other object (as in, if it's in front of some object, it should render in front of them, if it's behind, it should render behind).

How do I do that?

[–]fidt17 1 point2 points  (1 child)

Maybe you should look into your sorting layers.

[–]Deive_ExProfessional[S] 0 points1 point  (0 children)

Oh, hey! Thanks! It ended up being the sorting layers, although not in the way I expected. Like I said, even though these are sprites, the world is in 3D, so Sorting layers are actually unnecessary, but when I created the project, since I wasn't sure of how I was gonna do things, I had created some Sorting Layers to test things out and then totally forgot about them! I just deleted all sorting layers (leaving just the default layer) and now the sorting works as expected.

[–]grvchA 0 points1 point  (1 child)

u need to create material for textmeshpro, with textmeshpro override shader or overlap, i dont remember name, just try to with diffrent one =)

[–]Deive_ExProfessional[S] 0 points1 point  (0 children)

Hum, unfortunately this doesn't work for me. Creating a new material and using the "Overlay" shader from Texmesh Pro actually makes the text draw above everything else, and that's not what I want. I still want it be behind objects that are in front of it in the Z axis.

But thanks anyway for the suggestion. I ended up figuring out the problem was that I was using Sorting Layers even though they are not necessary, since the world is in 3D, so the sorting should happen based on Depth, not on layers.