Method MakeNetworkObjectTestPrefab
MakeNetworkObjectTestPrefab(NetworkObject, uint)
Normally we would only allow player prefabs to be set to a prefab. Not runtime created objects. In order to prevent having a Resource folder full of a TON of prefabs that we have to maintain, MultiInstanceHelper has a helper function that lets you mark a runtime created object to be treated as a prefab by the Netcode. That's how we can get away with creating the player prefab at runtime without it being treated as a SceneObject or causing other conflicts with the Netcode.
Declaration
public static void MakeNetworkObjectTestPrefab(NetworkObject networkObject, uint globalObjectIdHash = 0)
Parameters
Type | Name | Description |
---|---|---|
NetworkObject | networkObject | The networkObject to be treated as Prefab |
uint | globalObjectIdHash | The GlobalObjectId to force |