This is added to an object (A) and detects collisions with another object (B). However now what I want to do is to look at collisions between A and B from a third object (C). This needs to be extremely precise and up to date so basically I'm wondering if there is a piece of code I could use to say "If A intersects B then do this" that I could apply to C. I don't want to simply use variables and get them from another script because as I say it needs to be extremely up to date and there seems to be a small amount of lag when i do that :).
There should be no lag unless you search object C within your OnTriggerEnter() function everytime. Instead, search your object C in Awake() or Start() once (or directly assign it in the Inspector), and then refer to that variable. Then modify your script to call one of C's functions:
var objC : ObjectCScript;
function Awake () {
objC = Find("ObjectC's name").GetComponent(ObjectCScript);
}
function OnTriggerEnter (boxCollider : Collider) {
if(boxCollider.collider.name == "Box"){
objC.DetectedCollision();
}
}