#Issue Spawning Character for Character Creation

18 messages · Page 1 of 1 (latest)

golden valve
#

For some reason the server spawns it correctly, but something is up with the observers, I made sure to assign the client to the NetworkObject (gameobject) and instead of the character spawning I get a cube.

UnityEngine.Debug:LogError (object)
FishNet.Managing.Logging.LevelLoggingConfiguration:LogError (string) (at Assets/FishNet/Runtime/Managing/Logging/LevelLoggingConfiguration.cs:129)
FishNet.Managing.NetworkManager:InternalLogError (string) (at Assets/FishNet/Runtime/Managing/NetworkManager.Logging.cs:83)
FishNet.Managing.Server.ServerManager:ParseReceived (FishNet.Transporting.ServerReceivedDataArgs) (at Assets/FishNet/Runtime/Managing/Server/ServerManager.cs:791)
FishNet.Managing.Server.ServerManager:Transport_OnServerReceivedData (FishNet.Transporting.ServerReceivedDataArgs) (at Assets/FishNet/Runtime/Managing/Server/ServerManager.cs:665)
FishySteamworks.FishySteamworks:HandleServerReceivedDataArgs (FishNet.Transporting.ServerReceivedDataArgs) (at Assets/FishNet/Plugins/FishySteamworks/FishySteamworks.cs:293)
FishySteamworks.Server.ServerSocket:IterateIncoming () (at Assets/FishNet/Plugins/FishySteamworks/Core/ServerSocket.cs:410)
FishySteamworks.FishySteamworks:IterateIncoming (bool) (at Assets/FishNet/Plugins/FishySteamworks/FishySteamworks.cs:248)
FishNet.Managing.Transporting.TransportManager:IterateIncoming (bool) (at Assets/FishNet/Runtime/Managing/Transporting/TransportManager.cs:705)
FishNet.Managing.Timing.TimeManager:TryIterateData (bool) (at Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs:1018)
FishNet.Managing.Timing.TimeManager:IncreaseTick () (at Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs:672)
FishNet.Managing.Timing.TimeManager:<TickUpdate>g__MethodLogic|98_0 () (at Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs:342)
FishNet.Managing.Timing.TimeManager:TickUpdate () (at Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs:332)
FishNet.Transporting.NetworkReaderLoop:Update () (at Assets/FishNet/Runtime/Transporting/NetworkReaderLoop.cs:28)

My spawn function looks like this.

private void OnClientCustomizeRequest(NetworkConnection conn, ClientSpawnCustomizationRequestBroadcast data, Channel channel)
{
    var gender = data.gender;
    var response = 0;

    switch (gender)
    {
        case 0:
            var go = Instantiate(HumanMaleCharacter, SpawnLocation.transform.position, SpawnLocation.transform.rotation);
            InstanceFinder.ServerManager.Spawn(go, conn);
            Debug.Log("Human male spawned");
            go.transform.SetParent(SpawnLocation.transform);
            target = go.GetComponent<CharacterCustomizer>();
            SetLists();
            target.currentSkinData = Instantiate(skinAppearances[0].MaleSkin);
            target.SetSkin(target.currentSkinData);
            InstanceFinder.NetworkManager.SceneManager.AddOwnerToDefaultScene(go);
            response = 1;
            break;

The rest of the cases are just different genders and races.

#

I forgot to mute my youtube video on the other monitor. Apologies! LUL

brazen solar
#

HumanMaleCharacter is a network object prefab, right?

golden valve
#

Yes!

brazen solar
#

It shows up in the spawnable prefabs list I assume?

golden valve
brazen solar
#

So I mean the one on the NetworkManager. The spawnable prefabs scriptable object

golden valve
#

Ooof

#

Might have to fix that LUL

#

Will I have to add it to both the client and servers spawnables?

brazen solar
#

yep

#

Are you using different projects for both?

#

Or you just mean the editor and the build?

golden valve
#

No. I have it setup to where I can change build settings and it swaps the network managers based on what type i am in.

brazen solar
#

Ah gotcha

golden valve
#

I will try that 😂

#

That was definitely it. Can't believe I overlooked that.

#

Thanks! @brazen solar