Symet3
Symet3

Reputation: 53

The type or namespace name 'NetworkBehaviour' could not be found

I am trying to make a multiplayer game in Unity using "Netcode For Gameobjects" and I am following this tutorial: https://www.youtube.com/watch?v=stJ4SESQwJQ&ab_channel=Tarodev

@6:22 you can see that he changes it from MonoBehaviour to NetworkBehaviour, however when I try to do that I get prompted with this error: enter image description here

I have also tried to regenerate the .csproj files, that didn't work. I have installed everything that he has installed. And here you can see that NetworkBehaviour is still supported in "Netcode For Gameobjects". Here is my code where I am trying to implement the NetworkBehaviour:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;

public class PlayerController : NetworkBehaviour

Upvotes: 0

Views: 1081

Answers (1)

Symet3
Symet3

Reputation: 53

I fixed it. Apparently all I had to do was add using Unity.Netcode;

Upvotes: 2

Related Questions