Client-Sided Camera script: "PlayerController could not be found"
Hey, long story short, I am making a vehicle asset mod for a game on a unity base, Unturned and specifically, I am working on a MIG-21 radar, problem is that when there are two of these vehicles in the same area the second MIG vehicle asset "steals" the first MIG vehicle asset camera view resulting in both jets having one camera. I came to a conclusion to set up a client-sided camera with a C# script yet there are two errors that are stopping me from finishing this detail.
The error is as follows: errors CS0246: The type or namespace name "PlayerController" could not be found. Are you missing "UnityEngine.Networking" using directive?
The script: https://answers.unity.com/questions/1150051/unet-how-to-make-a-client-side-camera.html
// Update is called once per frame
void Update()
{
if (!this.transform.parent.GetComponent<PlayerController>().isLocalPlayer)
{
gameObject.GetComponent<Camera>().enabled = false;
gameObject.GetComponent<AudioListener>().enabled = false;
}
}
Visual shows PlayerController and isLocalPlayer as an error.
FYI, I am fairly new to unity and Visual is so far greek to me so I am more or less a noob at this at the moment. Cheers,
Your answer
Follow this Question
Related Questions
Client server camera streamer 1 Answer
Camera Switch Error 2 Answers
Why is my camera shaking when I use my chaser script on something? 0 Answers
Camera follow target glitches 1 Answer
Render to minimap on command 1 Answer