ParaObjectService.NetDestroy

Declaration

public static void NetDestroy(GameObject go, bool autoRequest = false)

Parameter

Parameter NameParameter Description
goSpecifies the network object to be destroyed.
autoRequestIndicates whether to automatically request ownership when a player has no ownership. The default value is false, which means "do not request automatically".

Description

Destroys a specified network object. Only a player with ownership can execute this method successfully. Ownership can be requested automatically by using a parameter.

function DestroyNetObject(key, pos, rotate)
  local instane = CS.ParaObjectService.NetSpawn(key, pos, rotate)
  CS.ParaObjectService.NetDestroy(instane)
end