#Multiplayer call function locally
12 messages · Page 1 of 1 (latest)
onKill.rpc_id(killer_peer_id)
but you should make onKill an rpc method with the call_local property. Check this page : https://docs.godotengine.org/en/stable/tutorials/networking/high_level_multiplayer.html
High-level vs low-level API: The following explains the differences of high- and low-level networking in Godot as well as some fundamentals. If you want to jump in head-first and add networking to ...
that isn't working, it says its not the authority, and isn't called on the player (resulting errors from my code):
@rpc("call_local")
func onKill():
print(is_multiplayer_authority()) # false
are all the players clients ? Or is one of them the server ?
The server is also a player
wait, I'm an idiot, you don't need the "call_local" if it's always called from an other player
just make it a basic rpc function
technically, nothing requires the onKill method to be local so if it's a basic rpc method that you call from the killed player, everything should work fine
FYI, depending on the competitiveness of what you are building and client-side authority, it'll be important to still validate the interactions to reduce the chance of cheating.
so can you recap, how should the function look and called?
I want to do local stuff on the player like animationss etc
For example, I want to call am animation on kill and it's locally.
The nodes of the hud are freed on the remote players