#I added a character selection, I can select it as a host and connect with the model I want, but when

19 messages · Page 1 of 1 (latest)

uneven solar
charred mica
#

That error on line 327 in Network Server was fixed already in a more recent release...replace the debug line there with this

Debug.LogWarning($"Spawned object not found when handling Command message netId={msg.netId}");

uneven solar
#

I tried but I get the same error, I'm so sorry

using System.Collections.Generic;
using Mirror;
using Steamworks;
using UnityEngine;
using UnityEngine.SceneManagement;

public class CustomNetworkManager : NetworkManager
{
    [SerializeField] private PlayerObjectController GamePlayerPrefab;

    public List<PlayerObjectController> GamePlayers = new List<PlayerObjectController>();

    public override void OnServerAddPlayer(NetworkConnectionToClient conn)
    {
        if (SceneManager.GetActiveScene().name == "Lobby")
        {
            if (GamePlayers.Find(player => player.ConnectionId == conn.connectionId) == null)
            {
                PlayerObjectController GamePlayerInstance = Instantiate(GamePlayerPrefab);
                GamePlayerInstance.ConnectionId = conn.connectionId;
                GamePlayerInstance.PlayerIdNumber = GamePlayers.Count + 1;
                GamePlayerInstance.PlayerSteamId = (ulong)SteamMatchmaking.GetLobbyMemberByIndex((CSteamID)SteamLobby.Instance.CurrentLobbyId, GamePlayers.Count);

                NetworkServer.AddPlayerForConnection(conn, GamePlayerInstance.gameObject);
            }
        }
    }

    [Server]
    public void StartGame(string SceneName)
    {
        ServerChangeScene(SceneName);
    }

    public override void OnServerDisconnect(NetworkConnectionToClient conn)
    {
        if (conn.identity != null)
        {
            PlayerObjectController player = conn.identity.GetComponent<PlayerObjectController>();
            GamePlayers.Remove(player);
        }
        base.OnServerDisconnect(conn);
    }

    public override void OnStopServer()
    {
        GamePlayers.Clear();
    }
    public void HostShutDownServer()
    {
        GameObject NetworkManagerObject = GameObject.Find("NetworkManager");
        Destroy(this.GetComponent<SteamManager>());
        Destroy(NetworkManagerObject);
        ResetStatics();
        SceneManager.LoadScene("Scene_Steamworks");

        Start();

    }
}
#

@charred mica

#

After updating the mirror library, I am having this problem when connecting to the lobby my friend created.

uneven solar
#

@charred mica

uneven solar
#

@grand fog

uneven solar
#

@charred mica please help me

charred mica
#

This seems to be a #steam issue - ask in that channel for steam issues. Maybe you have Steam Manager on same object as network manaager, or you're caching a ref to network manager instead of using the singleton everywhere...I can't really tell what you've done.

#

In any case, you need to dig the full stack trace of the error to find the exact error and line, make a dev build if needed. This is basic debugging process that you can do on your own without pinging people.

brave bloom
#

NM objen destroylanmış ve POC içinde 35.satırda null var bunu senin çözmen gerekmiyor mu sence de?

#

Her ufacık hatanda ping atıyorsun .d

uneven solar
#

I did everything I could but I still have the same problem.

uneven solar