How do I enable backface culling for sprites?

In my game, I’m using a 3D cube for the menu screen that rotates. On each side of the cube, I’m using sprite renderers for icons. The problem is that when the cube rotates, the sprites on the back of the cube are obscuring the camera. I tried writing a custom shader to do it, but I keep getting the error:

“Material uses a fixed function shader. It is not compatible with SpriteRenderer.”

How do I do this?

Hey DaemonR

The problem isn’t with the geometry but with the shader itself.

Is there a particular reason why you’re using the sprite shader in this case?

If you absolutely must use sprite shader, your best bet is to download the shader source:
Shaders source

From there you can simply enable backface culling in your new shader.