multiplayer

This commit is contained in:
Rendo 2025-11-22 01:07:18 +05:00
commit 0dc6247f91
22 changed files with 298 additions and 14 deletions

View file

@ -4,11 +4,19 @@ const COLLINEAR = 1.5707963267948966
@export var SENSITIVITY = 0.02
func _enter_tree() -> void:
set_multiplayer_authority(get_parent().name.to_int())
func _ready() -> void:
# Move to level controller when possible
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
#Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
if not is_multiplayer_authority():
return
current = true
func _input(event: InputEvent) -> void:
if not is_multiplayer_authority():
return
if event is InputEventMouseMotion:
get_parent().rotate_y(-event.relative.x * SENSITIVITY)
rotate_x(-event.relative.y * SENSITIVITY)