Skip to main content
Corrected method name
Source Link
Suddoha
  • 206
  • 1
  • 2

You're most-likely doing a wrong check in the Start function and it should read

if (gameControllerObject != null)
{
 ...
}

because you're trying to find the controller object by tag and have to verify that the return value of GameObject.FindFindWithTag(...) is not null. Otherwise you might risk running into a NullReferenceException.

You're most-likely doing a wrong check in the Start function and it should read

if (gameControllerObject != null)
{
 ...
}

because you're trying to find the controller object by tag and have to verify that the return value of GameObject.Find(...) is not null. Otherwise you might risk running into a NullReferenceException.

You're most-likely doing a wrong check in the Start function and it should read

if (gameControllerObject != null)
{
 ...
}

because you're trying to find the controller object by tag and have to verify that the return value of GameObject.FindWithTag(...) is not null. Otherwise you might risk running into a NullReferenceException.

changed "beginning" to "Start function" as that's where the code should be
Source Link
bornander
  • 4.7k
  • 1
  • 17
  • 27

You're most-likely doing a wrong check in the Start function and it should read

if (gameControllerObject != null)
{
 ...
}

because you're trying to find the controller object by tag and have to verify that the return value of GameObject.Find(...)GameObject.Find(...) is not nullnull. Otherwise you might risk running into a NullReferenceExceptionNullReferenceException.

You're most-likely doing a wrong check in the Start function and it should read

if (gameControllerObject != null)
{
 ...
}

because you're trying to find the controller object by tag and have to verify that the return value of GameObject.Find(...) is not null. Otherwise you might risk running into a NullReferenceException.

You're most-likely doing a wrong check in the Start function and it should read

if (gameControllerObject != null)
{
 ...
}

because you're trying to find the controller object by tag and have to verify that the return value of GameObject.Find(...) is not null. Otherwise you might risk running into a NullReferenceException.

changed "beginning" to "Start function" as that's where the code should be
Source Link

You're most-likely doing a wrong check in the beginningStart function and it should read

if (gameControllerObject != null)
{
 ...
}

because you're trying to find the controller object by nametag and have to verify that the return value of GameObject.Find(...) is not null. Otherwise you might risk running into a NullReferenceException.

You're most-likely doing a wrong check in the beginning and it should read

if (gameControllerObject != null)
{
 ...
}

because you're trying to find the controller object by name and have to verify that the return value of GameObject.Find(...) is not null. Otherwise you might risk running into a NullReferenceException.

You're most-likely doing a wrong check in the Start function and it should read

if (gameControllerObject != null)
{
 ...
}

because you're trying to find the controller object by tag and have to verify that the return value of GameObject.Find(...) is not null. Otherwise you might risk running into a NullReferenceException.

Source Link
Suddoha
  • 206
  • 1
  • 2
Loading