How can I make the camera movement smoother and not so jerky? (node camera2d)

Godot4.2.1, Gdscript

How can I make the camera movement smoother and not so jerky

extendes Camera2d

camera_speed = 15


func _input(event):
	if Input.is_action_pressed("up"):
		offset.y -= camera_speed
	if Input.is_action_pressed("down"):
		offset.y += camera_speed
	if Input.is_action_pressed("left"):
		offset.x -= camera_speed
	if Input.is_action_pressed("right"):
		offset.x += camera_speed

I think tweens is what you are looking for.

what is it?

Or phantomCamera2d. It’s this really great plugin, it’s better than the built in one, and does this easily. You can even get it in the asset library in the engine

1 Like

Everything began to move smoothly when I transferred the code to the function _physics_process!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.