FINISHED DAMN DROP SYSTEM
This commit is contained in:
parent
3302fcfc96
commit
100afe5e51
17 changed files with 151 additions and 25 deletions
|
|
@ -7,4 +7,29 @@ enum TEAMS {
|
|||
UNASSIGNED
|
||||
}
|
||||
|
||||
var dynamic_objects_container: Node3D
|
||||
var dynamic_objects_spawner: MultiplayerSpawner
|
||||
|
||||
func spawn(data: Dictionary) -> void:
|
||||
spawn_internal.rpc_id(1,data)
|
||||
|
||||
@rpc("any_peer","call_local","reliable")
|
||||
func spawn_internal(data: Dictionary) -> void:
|
||||
if multiplayer.is_server() == false:
|
||||
printerr(str(multiplayer.get_remote_sender_id())+" tried to spawn internally on "+str(multiplayer.get_unique_id()))
|
||||
return
|
||||
|
||||
var object = dynamic_objects_spawner.spawn(data)
|
||||
|
||||
if data.has("position"):
|
||||
object.global_position = data.position
|
||||
|
||||
func despawn(path: NodePath):
|
||||
despawn_internal.rpc_id(1,path)
|
||||
|
||||
@rpc("any_peer","call_local","reliable")
|
||||
func despawn_internal(path: NodePath) -> void:
|
||||
if multiplayer.is_server() == false:
|
||||
printerr(str(multiplayer.get_remote_sender_id())+" tried to despawn internally on "+str(multiplayer.get_unique_id()))
|
||||
return
|
||||
|
||||
get_node(path).queue_free()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue