6/14/2018 7:24:47 PM

Get the C# class of a script connected to an object.

MyClassName myClassObj = transform.gameObject.GetComponent(); if (myClassObj != null) { //call a function on the attached script myClassObj.AFunctionInThatScript(); }