WIP: Some updates

This commit is contained in:
2025-02-09 20:14:24 +01:00
parent 275d697f60
commit ccc43e9c4b
9 changed files with 93 additions and 66 deletions

View File

@ -25,14 +25,16 @@ func spawn_players(spawn_location: SpawnController, id: int) -> Error:
_get_root().add_child(char)
char.shared_node.global_position = new_position
#var model_scene: PackedScene = ResourceLoader.load("res://scenes/characters/y-bot/character.tscn")
#var model: CharacterWrapper = model_scene.instantiate()
#model.global_position = new_position
#model.set_owner_placeholder(char)
#_get_model_root().add_child(model)
return OK
return ERR_UNAUTHORIZED
func spawn_player_model(owner_node: CharacterBody3D):
var model_scene: PackedScene = ResourceLoader.load("res://scenes/characters/y-bot/character.tscn")
var model: CharacterWrapper = model_scene.instantiate()
model.global_position = owner_node.global_position
model.owner_placeholder = owner_node
_get_model_root().add_child(model)
func remove_player(id: int) -> Error:
if multiplayer.is_server():
var found_childen: Array[Node] =_get_root().get_children()