Initial commit

This commit is contained in:
2026-01-21 23:51:53 +01:00
commit 60b208fee0
1703 changed files with 100223 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
extends Node3D
var followTarget: Node3D
var followedPlayerIndex: int = 0
var mouseSensetivity: float = 0.1
func _ready() -> void:
activateCamera()
func _process(_delta: float) -> void:
updateFollowTarget()
if followTarget:
global_position = followTarget.global_position
func _input(event: InputEvent) -> void: #Camera movement with mouse
if event is InputEventMouseMotion && Input.mouse_mode == 2:
rotation.x = clampf(rotation.x - deg_to_rad(event.relative.y * mouseSensetivity),-PI/8,PI/4)
rotation.y -= deg_to_rad(event.relative.x * mouseSensetivity)
func updateFollowTarget() -> void:
if Input.is_action_just_pressed("throw"):
followedPlayerIndex += 1
if followedPlayerIndex >= Multiplayer.playerDict.size():
followedPlayerIndex = 0
followTarget = Multiplayer.playerDict.values()[followedPlayerIndex]
func activateCamera() -> void:
$SpringArm3D/Camera3D.current = true