killbox/scenes_old_2/player/gun_mount.gd

16 lines
467 B
GDScript3
Raw Normal View History

2025-02-06 12:42:14 +00:00
extends Node3D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
2025-02-18 12:30:48 +00:00
pass # Replace with function body.
2025-02-06 12:42:14 +00:00
@export var follow_speed: float = 5.0
2025-02-18 12:30:48 +00:00
2025-02-06 12:42:14 +00:00
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var target_position = global_transform.origin # Camera's world position
global_transform.origin = lerp(global_transform.origin, target_position, follow_speed * delta)