ParaPlayer.NetSpawn

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 NameParameter Description
keyKeyword of the spawned object. This object needs to be registered in ParaWorldRoot.NetSpawnObjects.
positionInitial position of the spawned object
rotationInitial orientation of the spawned object
out int idUnique 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.