Tewam spawner

This commit is contained in:
Rendo 2025-11-27 11:02:42 +05:00
commit 2bfbfa5089
8 changed files with 126 additions and 67 deletions

View file

@ -3,6 +3,16 @@ extends Camera3D
@export var SENSITIVITY = 0.02
@export var SPEED = 10.0
func _enter_tree() -> void:
set_multiplayer_authority(int(name))
func _ready() -> void:
if not is_multiplayer_authority():
return
# Move to level controller when possible
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
current = true
func _process(delta: float) -> void:
var xz_plane = Input.get_vector("plr_strafe_l","plr_strafe_r","plr_forward","plr_back")
var y = Input.get_axis("spc_down","spc_up")
@ -18,3 +28,7 @@ func rotate_camera(x,y) -> void:
func _input(event: InputEvent) -> void:
if event is InputEventMouseMotion:
rotate_camera(-event.relative.x * SENSITIVITY,-event.relative.y * SENSITIVITY)
@rpc("any_peer","call_local","reliable")
func set_start_position(start_position: Vector3):
global_position = start_position