Declaration
public static GameObject NetSpawn(string key, out int id)
public static GameObject NetSpawn(string key, Vector3 position, out int id)
public static GameObject NetSpawn(string key, Vector3 position, Vector3 rotation, out int id)
Parameters
Parameter Name | Parameter Description |
---|---|
key | Keyword of the spawned object. This object needs to be registered in ParaWorldRoot.NetSpawnObjects. |
position | Initial position of the spawned object |
rotation | Initial orientation of the spawned object |
out int id | Unique ID of the spawned object. This ParaObject can be obtained by using ParaObjectService.GetParaObject. |
Response
The spawned object
Description
Creates a network object bound with the character. The object's lifecycle is consistent with that of the creator and its ownership cannot be transferred.
The object destruction logic of this method is similar to that of ParaObjectService.NetSpawn, that is, players need to call ParaObjectService.NetDestroy for object destruction.