Also, happy 2025!
Status update: The server .event.rpc() works. I did it by saving the instantiated player in a higher scope (from function to the server script). Then, calling the player’s RPC events when the client calls them.
This is in the server network manager.
var Perm_Player_Ref
func load_player(id) -> void:
if not multiplayer.is_server(): return
if has_node(str(id)):
print("A player with ID ", id, " already exists.")
return
var Player_Ref := Player.instantiate()
Player_Ref.name = str(id)
Player_Ref.Client_Input = "NetworkManager"
Player_Container.add_child(Player_Ref, true) #Triggers Multiplayer Spawner
Perm_Player_Ref = Player_Ref
It’s quite stuttery right now, but I bet it can be smoothed out when I implement it better (id checking) and add more features.
I’m not marking this as the solution yet, because I want to try out the method you suggested. After I do that, I’ll edit this comment with an update.
Edit: Ok Penny, I understand how your implementation works. The client manager uses the multiplayer spawner as a reference. Then, attaches player information like their id. Lastly, it… connects… input???
There are quite a few issues with this method.
- I’m planning to replace the multiplayer spawner with a custom RPC implementation. Same as I did for the multiplayer synchronizer.
- This RPC implementation is also done by the server network manager. Absolutely positively NOT the client.
So, method 1 was the solution. I can now have an online communication network between the client, the server, and the player. There’s still a lot more work to do, but I know that path forward. Thanks for your help @pennyloafers!