I have a farm fence in unity but is only one sided. so when you play the game and look at it from behind it is no longer there. how do i get it to be double sided from front to back? Do i use a shader script or something else? thx!
The easiest solution would be to make the fence out of two faces.
What shader are you using?
Here’s a VertexLit shader that renders both sides:
Shader "VertexLit DoubleSided" {
Properties {
_Color ("Main Color", Color) = (1,1,1,0)
_SpecColor ("Spec Color", Color) = (1,1,1,1)
_Emission ("Emmisive Color", Color) = (0,0,0,0)
_Shininess ("Shininess", Range (0.01, 1)) = 0.7
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Pass {
Material {
Diffuse [_Color]
Ambient [_Color]
Shininess [_Shininess]
Specular [_SpecColor]
Emission [_Emission]
}
Lighting On
Cull Off
SeparateSpecular On
SetTexture [_MainTex] {
Combine texture * primary DOUBLE, texture * primary
}
}
}
}
if you are searching for additional scripts or functionality, you could always search the unify wiki.
there you can get the shader mentioned above.