Enable Components
So I've got the multi-player annoyance of cameras and individual movement but the fix on the tutorial I'm following doesn't work.
What I have:
((MonoBehaviour)myPlayerGO.GetComponent("FPSInputController")).enabled = true;
((MonoBehaviour)myPlayerGO.GetComponent("MouseLook")).enabled = true;
myPlayerGO.transform.FindChild("Main Camera").gameObject.SetActive(true);
I want to enable "FPSInputController", "MouseLook" and "Main Camera".
Thanks, Alfie
The movement no longer conflict between players. Except the cameras still conflict (IE One game instance controls left/right and the other up/down).
The original purpose to enabling a default disabled component was to make sure that they only had a direct effect client side.
This seems to of fixed everything but the camera. But if I was to go about enabling it via a script, what should I disable. The small camera component attached to a smaller prefab inside the character controller, or the entire smaller prefab called, "$$anonymous$$ain Camera" ins$$anonymous$$d. I have tried enabling/disabling both but the codes I have used don't work with either.
Thanks, Alfie
Answer by hexagonius · Jan 23, 2016 at 10:15 PM
myPlayerGO.GetComponent<FPSInputController>().enabled = true;
myPlayerGO.GetComponent<MouseLook>().enabled = true;
don't know about the last one. I mean, what isn't working?
Camera.main.gameobject.SetActive(true);
maybe
In addition to my previous comment the camera is inside the character prefab.
Your answer
Follow this Question
Related Questions
Attack on Titan Multiplayer Problem 2 Answers
Customizing multi player 1 Answer
Keep list of gameobjects on server multiplayer 0 Answers
Is Unity uNet multiplayer system free? 0 Answers
Healthbar in a Multiplayer game 0 Answers