• 3D
  • Problems with 3D Sprites and Transparent Materials.

https://youtu.be/4Vq5cMngd7Y

So, I'm making an endless runner with 3d sprites and 3d models with transparent material. But as you can see from the video I've posted on youtube, I'm facing a problem. My main character's sprite tends to disappear whenever she gets close to the edge.

The reason this happens is that transparent objects are drawn separately from opaque objects and they don't always mix well. In particular, transparent objects are drawn after all the opaque objects are draw. I'm not sure, but my guess is that the sorting is done based on the center point of the object, which is why your character disappears after reaching the center of the floor. So this would be the problem.

One thing you can do to override this, is to change the render priority on the material. This is sort of like layers in Photoshop. So if you make your character on render priority 1, it will draw over level 0 (the default). You could also make the floor -1. This will probably fix it.

However, I am unsure why you are making the floor transparent. This does not seem to be a good choice. Transparent drawing is slower, and also causes issues with the depth sorting and intersection (the issue you have in the video), so should only be used when needed (such as for windows or water). I don't understand how or why a floor could be transparent. Most likely you want to use fog instead (on the WorldEnvironment) which will get a similar effect, and be much faster and not have any issues.

Thanks a lot for answering my question. Your answer solved my problem! The reason I'm using transparent material is that I've made my model using sprytile blender that lets me convert my pixel art tilemaps into 3d models. The windows are part of the room that's why I want the whole thing to be transparent.