GrappleTest/Player/Camera/CameraController.gd

11 lines
278 B
GDScript3
Raw Normal View History

2024-02-26 08:28:11 -06:00
extends Camera2D
@onready var player = $"../"
func _process(delta):
var velocModifier = clamp(abs(player.velocity.x) - 700, 0, 1000)
var direction = clamp(player.velocity.x, -1, 1)
position = (get_local_mouse_position() / 3)
position.x += velocModifier * direction / 10