Hey all,
hopefully this is quick and easy :
scriptA contains a coroutine and is the only copy in the scene. It accesses this routine, performs some junk then calls upon other coroutines to calculate some other junk. Works just fine.
scriptB needs access to this routine as well ((it is attached to a separate gameObject)).
ScriptA:
public static IEnumerator GetInRange(GameObject m, float mass){
//Do some stuff
//Call another routine to do some other stuff
yield return null;
}
ScriptB:
StartCoroutine (ScriptA.GetInRange(m, mass));
Before the addition of scriptB, scriptA works 100%. The only difference in code is that Iāve added āstaticā to scriptAās IEnumerator so that ScriptB may find it without an object reference. Though, with this itās now causing the coroutines which scriptA calls to fail, stating that :
An object reference is required to access non-static member
They do not error without the addition of scriptB and the āstaticā mentioned above AND the object in question in-fact is scriptAās gameobject, thus a object reference should not be required. Because it is āmy own objectā. Additionally, Iāve tried making these routines static as well, though it shouldnāt matter, and doesnāt change anythingā¦so I guess It doesnāt matter. Either way, Iām stumped.
Any suggestions would be great, thanks in advance!