Closed devfox-se closed 2 months ago
There's a requirement even if all players are specifying their own prefab hashes that the NetworkManager's Player Prefab field be set with a prefab value. I always thought this a bug, maybe we'll get some clarification on this.
@ezoray @devfox-se Yeah that is indeed a bug and shouldn't be checking something that could potentially be null. I will get something together and merged by early next week (it is a simple fix and should be a relatively easy integration test to validate). Until then, I would recommend just putting a "dummy" prefab on the NetworkManage.NetworkConfig.PlayerPrefab to avoid that issue.
Hi
I have a custom player prefabs where each client sends a payload of the prefab he had chosen to play with, the server has Connection Approval enabled and from there I successfully decode the data and find the appropriate prefab that should be attached to the player
The problem I am facing comes short after callback finishes execution
Specifically, issue is on this line as
PlayerPrefab
is null for some reasonhttps://github.com/Unity-Technologies/com.unity.netcode.gameobjects/blob/develop/com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs#L741
The prefab has
NetworkObject
attached to it and its inNetwork Prefabs List
See my approval callback and how I grab the
PlayerPrefabHash
from my prefabIn the console I can see that
response.PlayerPrefabHash
is populated properly but the package fails to set the playerprefab after all.Please advice what can be the issue in here? Tested on both
1.8.1
and1.11.0