Hello. I know how to make it so that a function happens when the object that a collision script (like the one below) is attached to collides with another object, but is there a way to make a script that references another object for both objects? For example, the script is attached to object A and it says something like "When object B enters the trigger of an object with the tag “C” object B = destroyed)? Thanks.
function OnTriggerEnter (other : Collider) {
if (other.gameObject.CompareTag ("Enemy")) {
Stats.Life -=1;
Player.enabled = false;
Light.enabled = false;
Invoke("LightsOn", Timer);
};