Spectator, gui 👍

This commit is contained in:
Rendo 2025-12-07 17:07:51 +05:00
commit 775763a128
9 changed files with 55 additions and 31 deletions

View file

@ -10,3 +10,7 @@ func _ready() -> void:
func reverse() -> void:
get_parent().visible = not get_parent().visible
func reverse_if_own():
if multiplayer.get_unique_id() == reference_player.player_id:
reverse()

View file

@ -32,7 +32,7 @@ func _process(_delta: float) -> void:
if not is_multiplayer_authority(): return
direction = Input.get_vector("plr_strafe_r","plr_strafe_l", "plr_back","plr_forward")
func _input(event: InputEvent) -> void:
func _unhandled_input(event: InputEvent) -> void:
if not is_multiplayer_authority(): return
if event.is_action_pressed("plr_ult"):
switch_on_server.rpc_id(1,"ultimate")

View file

@ -288,4 +288,4 @@ func kill_site(site: StringName) -> void:
for body in plant_deadzones[site].get_overlapping_bodies():
if body is Player:
body.kill_request.rpc()
body.die()

View file

@ -54,6 +54,6 @@ func spawn_spectator(id: int) -> void:
var distance = randf_range(0,spawn_radius)
var angle = randf_range(0,TAU)
var new_position = global_position + Vector3.RIGHT.rotated(Vector3.UP,angle) * distance
inst.team = team
#inst.team = team
get_parent().add_child(inst)
inst.global_position = new_position