death multiplayer sync
This commit is contained in:
parent
6422ffb13c
commit
37a17878e4
5 changed files with 14 additions and 5 deletions
|
|
@ -33,12 +33,19 @@ func _physics_process(_delta: float) -> void:
|
|||
move_and_slide()
|
||||
|
||||
func die() -> void:
|
||||
if not is_multiplayer_authority():
|
||||
if (not is_multiplayer_authority()):
|
||||
return
|
||||
|
||||
global_position = TEMP_start_pos
|
||||
hp = MAX_HP
|
||||
|
||||
@rpc("any_peer","call_local","reliable")
|
||||
func kill_request() -> void:
|
||||
if multiplayer.get_remote_sender_id() != 1:
|
||||
return
|
||||
|
||||
die()
|
||||
|
||||
@rpc("any_peer","call_local","reliable")
|
||||
func set_after_spawn(start_position: Vector3,new_team: int):
|
||||
global_position = start_position
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue