Skip to main content
Code formatting
Source Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

I am trying to make GameObject.Find() work in batchmode but for some reason it returns a null object.

my code:

public class test: Monobehaviour { public static GameObject go; static void doing() { go = GameObject.Find ("testing"); } } //testing is the name of the gameobject in the editor

public class test: Monobehaviour {
    public static GameObject go;

    static void doing()
    {
        go = GameObject.Find ("testing");
    }
}
//testing is the name of the gameobject in the editor

I call it from the console on mac using: /Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -projectPath "" -executeMethod test.doing

I am trying to make GameObject.Find() work in batchmode but for some reason it returns a null object.

my code:

public class test: Monobehaviour { public static GameObject go; static void doing() { go = GameObject.Find ("testing"); } } //testing is the name of the gameobject in the editor

I call it from the console on mac using: /Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -projectPath "" -executeMethod test.doing

I am trying to make GameObject.Find() work in batchmode but for some reason it returns a null object.

my code:

public class test: Monobehaviour {
    public static GameObject go;

    static void doing()
    {
        go = GameObject.Find ("testing");
    }
}
//testing is the name of the gameobject in the editor

I call it from the console on mac using: /Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -projectPath "" -executeMethod test.doing

added 147 characters in body
Source Link
NAnn
  • 339
  • 1
  • 5
  • 14

I am trying to make GameObject.Find() work in batchmode but for some reason it returns a null object.

my code:

public class test: Monobehaviour { public static GameObject go; static void doing() { go = GameObject.Find ("testing"); }

The execute method is name of class.doing and testing} //testing is the name of the gameobject in the editor

I call it from the console on mac using: /Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -projectPath "" -executeMethod test.doing

I am trying to make GameObject.Find() work in batchmode but for some reason it returns a null object.

my code: public static GameObject go; static void doing() { go = GameObject.Find ("testing"); }

The execute method is name of class.doing and testing is the name of the gameobject in the editor

I am trying to make GameObject.Find() work in batchmode but for some reason it returns a null object.

my code:

public class test: Monobehaviour { public static GameObject go; static void doing() { go = GameObject.Find ("testing"); } } //testing is the name of the gameobject in the editor

I call it from the console on mac using: /Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -projectPath "" -executeMethod test.doing

Source Link
NAnn
  • 339
  • 1
  • 5
  • 14

Unity GameObject.Find() not working in batchmode?

I am trying to make GameObject.Find() work in batchmode but for some reason it returns a null object.

my code: public static GameObject go; static void doing() { go = GameObject.Find ("testing"); }

The execute method is name of class.doing and testing is the name of the gameobject in the editor