unity check if object is colliding with object from layer code example
Example: unity check if other object is colliding
public void OnCollisionEnter(Collision collision)
{
// Do your stuff here
}
//if your collider is a trigger
public void OnTriggerEnter(Collider other)
{
// Do your stuff here
}