godot-ultimate-tutorial/scenes/player/camera.gd

6 lines
143 B
GDScript3
Raw Normal View History

extends Camera2D
func handle_offset(dir: Vector2, delta: float):
var desired_offset = dir*500
offset = offset.lerp(desired_offset, delta*2)