look like it works now, i did a workaround, dunno what this issue was 💀

This commit is contained in:
Tabby 2025-08-11 23:34:05 +10:00
parent 7584cf0b19
commit 8c0860a840
8 changed files with 64 additions and 44 deletions

View file

@ -1,9 +1,11 @@
extends Camera2D
var target : Node2D
@export var temp_segment : Node2D
#var target : Node2D
#@export var temp_segment : Node2D
@export var snake_line : Line2D
@export var player : Node2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
@ -11,22 +13,21 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if (Input.is_action_just_pressed("test_switch_cam")):
if(target):
target = null
else:
target = temp_segment
if target:
if Router.player_mode:
# TODO FIX
#position = lerp(position, target.position, 0.6 * delta)
#zoom = lerp(zoom, Vector2(1,1),0.6 * delta)
position = target.position
#position = Router.current_seg.position
position = player.global_position
zoom = Vector2(1,1)
snake_line.modulate = Color(1,1,1,0.5)
snake_line.modulate = Color(1,1,1,1)
z_index = 0
snake_line.z_index = 9
else:
position = Vector2(0,0)
zoom = Vector2(0.05,0.05)
snake_line.modulate = Color(1,1,1,1)
snake_line.z_index = 11
z_index = 1