- Home /
Sup orthographic camera?
Hey guys!
Is there a way to fix this?
I have a bunch of pineapples. They represent my character. They move on position.y = 1;
I have a generated mesh for the terrain. I have some voxels at position.y = 3; to serve as rooftops n such.
I expect my characters to be rendered on top of the terrain at position.y = 0 and beneath the heightened voxels at position.y = 3; Once the higher up voxels are rendered, the entire gameobject chunk is rendered on top of the pineapples!!
EDIT: Tomer, I've added the transforms as you requested. You can see the player is on top of the origin point of the generated mesh terrain, he is usually rendered on top. However, when I add a layer of roof, the highest point of the mesh is then higher than the player position. The entire mesh gets rendered on top of my sprites.
Show in-game inspector values for each of the objects please. Specifically the transform and the sprite renderer are needed.
I think that you should change the Sort Layer of the pineapples because they are sprites.
Pablo, thanks for your response. However this method either makes everthing on top of the terrain mesh or everything below it. I'm wondering if its just the nature of using meshes and sprites in the same scene... Could you convert your answer to a comment so this question gets the attention of an unanswered question? People tend to ignore questions that already have an answer. Would you kindly? Thanks.
Sure! I think it would be better if you sort everything with a Sorting Layer. For example, maybe you can put your pineapples with a higher sorting layer than the terrain, let's say a 5 for the pineapples. And the terrain, you can change it to a lower sorting layer, like 0. Then everything less than 0 will be under the terrain and everything higher than 5 will be on the top of your pineapples. If your terrain it's a 3D plane, I suggest you to remove it and make it also a sprite. But it will be very helpful to see how are you doing your game and what are you trying exactly to do.
Thanks Pablo, my problem right now is: it is essentially a voxel terrain engine. When i draw dirt and grass, it edits blocks at y = 0, when i draw trees and walls it edits blocks at y = 1. When i draw a roof, it edits blocks at y = 3. I could split the roof layer into another chunk, but that just adds complexity that I'm trying to avoid. I'd like to try to figure this out if possible.
Is there a way to make my texture a bunch of sprites ins$$anonymous$$d of texture on a mesh? I guess I could do that, and play with layers afteward... You might be on to something, let me think about that.
Your answer
![](https://koobas.hobune.stream/wayback/20220613193143im_/https://answers.unity.com/themes/thub/images/avi.jpg)