- Home /
Double sided 2d sprite
so im working on a 2d game and when I want my character to turn the other way by flipping the image nothing is displayed on the other side. is there any way to make the image double-sided? i am also using a diffused shader to have shadows affect the 2d image.
Answer by Sinterklaas · May 16, 2021 at 06:53 PM
This likely happens because when you flip a sprite, its normals are inversed. This means that the back faces are now facing the camera, which are culled by default.
To prevent this from happening, I believe you're going to have to edit the shader. The source code for this particular shader can be found here: https://github.com/TwoTailsGames/Unity-Built-in-Shaders/blob/master/DefaultResourcesExtra/Alpha-Bumped.shader
At line 13, add a line with the following code:
Cull Off
I believe that should do the trick. You should probably also give the shader a new name (which can be done on line 3). Now just create a new material with your new shader, and if I'm right, your flipped sprites should now be visible.
Your answer
Follow this Question
Related Questions
Change a prefab's sprite in all scenes? 2 Answers
Pixels per unit with tile palette? 1 Answer
2D sprite wavering 0 Answers
How to make "circle" sprite’s border more smooth? 1 Answer
Blur 2d Sprite 0 Answers