I created a fairly simple 2D rummy-like card game. One player against 3 bots.
I’m trying to make it multiplayer.
I cloned a Netcode Lobby app and added my canvas to the main scene. I can connect a host and one or more clients to the same game, but all players get their own copy of the canvas. I want each player to see the same canvas, eventually with different views of the tabletop and different cards in their hands.
I probably don’t need Player objects at all, but seeing two or more player prefabs on the same plane confirms that both players are in the same “world”.
I suspect the canvas just needs a simple setting change, but nothing was worked yet. I added Network Object and Network Transform components, changed MonoBehavior to NetworkBehavior, and put the canvas inside the NetworkManager
In case it helps, here are the first few lines of a script on the canvas:
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEditor;
using System;
using System.Text.RegularExpressions;
using Unity.Netcode;
public class DeckOfCards : NetworkBehaviour //MonoBehaviour
{
#region variables
public Text MessageText;
public Text[ ] OppMessageText = new Text[4];
public Text ScoreText;
public CardInDeck thisCard;
…
Many thanks to anyone who can tell me anything.