Hi all,
Code
public static FPSCoordinator instance
{
get
{
if (m_instance == null)
{
m_instance = GameObject.Find( "FPSCoordinator" ).GetComponent<FPSCoordinator>();
m_instance.m_photonView = m_instance.gameObject.GetComponent<PhotonView>();
}
return m_instance;
}
}
ERROR
UnityException: You are not allowed to call this function when declaring a variable.
Move it to the line after without a variable declaration.
If you are using C# don't use this function in the constructor or field initializers, Instead move initialization to the Awake or Start function.
FPSCoordinator.get_instance () (at Assets/2-Scripts/NetworkFramework/FPSCoordinator.cs:127)
FPSCamera..ctor ()
i am getting the error listed above in the given line
m_instance = GameObject.Find( "FPSCoordinator" ).GetComponent<FPSCoordinator>();
can anyone please help me out in solving this error.