Trying to convert my singleplayer game to a mutiplayer version that has a lobby system using this Unity Asset Store - The Best Assets for Game Making
and this particular line of code has an issue that I don’t know how to fix:
int localPlayerCount = 0;
foreach (PlayerController p in ClientScene.localPlayers)
localPlayerCount += (p == null || p.playerControllerId = -1) ? 0 : 1;
the problem is in the foreach line which says that it cannot convert type UnityEngine.Networking.PlayerController to PlayerController
My PlayerController Script is extending from another Class which has a NetworkBehaviour instead of a Monobehaviour so that should be fine?
public class PlayerController : LivingEntity
In LivingEntity:
public class LivingEntity : NetworkBehaviour, IDamageable//(interface)
So what is the problem here? Unity doesn’t allow me to continue if this script isn’t fixed ![]()