Godot Version
GodotSteam 4.4
Question
Why does this function work for the host but not for the client
The Auto Spawn List also includes the same enemy paths, so I don’t think it’s a security issue !
func _on_spawn_timer_timeout():
if not multiplayer.is_server(): return
if enemies_spawned_this_level >= enemy_count or available_spawn_points.is_empty():
spawn_timer.stop()
return
var spawn_position = available_spawn_points.pick_random()
var enemy_scene_path = ENEMY_SCENE_PATHS.pick_random()
var data_to_send = {
"scene_path": enemy_scene_path,
"pos": spawn_position,
"name": "Enemy_" + str(randi())
}
enemy_spawner.spawn(data_to_send)
print(data_to_send)
enemies_spawned_this_level += 1