"using UnityEngine.Networking" don't work

using UnityEngine;
using UnityEngine.Networking;

public class PlayerController : NetworkBehaviour
{
    public float movementSpeed = 5.0f;
    public float rotationSpeed = 200.0f;

    void Update()
    {
        if (isLocalPlayer)
        {
            transform.Rotate(0, Input.GetAxis("Horizontal") * Time.deltaTime * rotationSpeed, 0);
            transform.Translate(0, 0, Input.GetAxis("Vertical") * Time.deltaTime * movementSpeed);
        }
    }
}

TRANSLATE

I make this script for a multiplayer game with the last version of “VisualStudio” and “Unity 2019.4.1f1”.

With this script I want to tell unity that you can only move your player, and not others too, but unity does not recognize the “NetworkBehaviour” and “isLocalPlayer” commands.

Anyone know what the problem is?

Ok I solved it by adding “using Mirror” to the script.

using Mirror;
using UnityEngine;
using UnityEngine.Networking;

public class PlayerController : NetworkBehaviour
{
    public float movementSpeed = 5.0f;
    public float rotationSpeed = 200.0f;
    void Update()
    {
        if (isLocalPlayer)
        {
            transform.Rotate(0, Input.GetAxis("Horizontal") * Time.deltaTime * rotationSpeed, 0);
            transform.Translate(0, 0, Input.GetAxis("Vertical") * Time.deltaTime * movementSpeed);
        }
    }
}