How to make a sprite/gameobject go invisible in shadows

So Im making this project and I was wondering how can i make the objects look invisible in shadows
i mean specifically the parts that are in the shadows (they should be visible because there are more lights on their path that are about to reveal those GameObjects)
alt text

For this example I used Sprite-Diffuse Texture (for the bg and the dudes) to achieve this trick but it still doesn’t give the effect i want
(and I kind of played with celshading there… But I kept it there because I liked the effect it gives but still not what I want)

Ill be happy to give u more info in order to solve this question :slight_smile:

2D/Unity free/C#/Newbie

GameObject MyUnit = gameObject;//This is the root object
public float shadowAlpha;//The minimum alpha for the unit to be displayed; you might have to play with this value to get it working right.

void Update()
{
if (renderer.material.color.a <= shadowAlpha)
{
Transform[] ChildrenRenderers = transform.GetComponentsInChildren<Renderer>();
foreach (childRenderer in ChildrenRederers){
renderer.enabled = false;
}
}
}

-SOLVED!-
For my game I dont need to see anything that is not litted so I’ve just wondered why I can see people without no lights
and I came to idea there is Ambient light by default
So i went to the render settings and changed the Ambient Light to black :slight_smile:

alt text
alt text

Thx for helping! :slight_smile: