Method Instantiate
Instantiate(ulong, Vector3, Quaternion)
Client Side Only Once an implementation is registered with the NetworkPrefabHandler, this method will be called every time a Network Prefab associated NetworkObject is spawned on clients
Note On Hosts: Use the RegisterHostGlobalObjectIdHashValues(GameObject, List<GameObject>) method to register all targeted NetworkPrefab overrides manually since the host will be acting as both a server and client.
Note on Pooling: If you are using a NetworkObject pool, don't forget to make the NetworkObject active via the SetActive(bool) method.
Declaration
NetworkObject Instantiate(ulong ownerClientId, Vector3 position, Quaternion rotation)
Parameters
Type | Name | Description |
---|---|---|
ulong | ownerClientId | the owner for the NetworkObject to be instantiated |
Vector3 | position | the initial/default position for the NetworkObject to be instantiated |
Quaternion | rotation | the initial/default rotation for the NetworkObject to be instantiated |
Returns
Type | Description |
---|---|
NetworkObject |