Can anyone tell me how I would port this javascript code to C#?
var compScr = collision.gameObject.GetComponent(scriptName);
compScr.MyFunc();
I’ve tried
Object compScr = collision.gameObject.GetComponent(scriptName);
(Types.GetType(colHandler.scriptName))compScr.MyFunc();
Unfortunately, this doesn’t compile.