I’m trying to create a multiplayer game, I was following a tutorial for Photon Unity Networking asset, but I stumbled upon some problems, my network manager script is type of C# script.
I have a function called SpawnMyPlayer after everything else has been succesfull, My t components works perfectly just doing :
(I’m using the standard asset for unity)
player.GetComponent<CharacterController> ().enabled = true;
player.GetComponent<PlayerVariables> ().enabled = true;
player.GetComponent<MouseLook> ().enabled = true;
player.GetComponent<EscapeMenu> ().enabled = true;
player.GetComponent<Inventory> ().enabled = true;
Which works just fine, and as expected they do get changed ingame as well when looking at information.
But the 2 js scripts cannot be found using the normal template operator.
I tried doing just:
player.GetComponent("FPSInputController").gameObject.SetActive (true);
player.GetComponent ("CharacterMotor").gameObject.SetActive (true);
But this simply does not work, they do not get enabled.
Any help towards solving this is very appreciated