public int characterLayer = 10; // change this value according your character layer
void OnTriggerEnter(Collider _collider)
{
if (_collider.gameObject.layer == characterLayer)
{
Destroy(gameObject); // This will destroy the current gameObject where this script is attached, if you only want to dissapear this object just disable their renderer instead of destroying
}
}
And attach a collider with Trigger enabled on this gameObject.