camera rotation sync

This commit is contained in:
Rendo 2025-12-03 16:12:57 +05:00
commit fb480e0a8b
3 changed files with 20 additions and 22 deletions

View file

@ -8,6 +8,7 @@ class_name Player
set(id):
player_id = id
$PlayerInput.set_multiplayer_authority(id)
$Camera3D.set_multiplayer_authority(id)
var passived: bool = false

View file

@ -78,8 +78,6 @@ func switch(to: StringName, exit: bool = true):
ammo_updated.emit(current_state.ammo,current_state.remaining_ammo)
switched_to.emit(current_state)
update_remotes.rpc(to,exit)
func return_to_previous(exit: bool = true):
if last_slot != "":
@ -87,15 +85,6 @@ func return_to_previous(exit: bool = true):
else:
switch("knife", exit)
@rpc("authority","call_remote","reliable")
func update_remotes(to: StringName,exit: bool):
if current_state != null and exit:
current_state.exit()
current_state = slots[to]
current_state.enter()
switched_to.emit(current_state)
func drop_current():
drop(current_state)