I saw
for(var i:Transform in gameobj.transform)
{
Debug.Log(i);
}
but it doesn’t work with scripts as they have no transforms
I saw
for(var i:Transform in gameobj.transform)
{
Debug.Log(i);
}
but it doesn’t work with scripts as they have no transforms
Hi, As all scripts that you can attach to a gameobject inherit from Monobehaviour you can get a list of the attached scripts by doing:
C#
scripts = gameObject.GetComponents<MonoBehaviour>();
for(int i = 0; i < scripts.Length; i++){
MonoBehaviour data = scripts*;*