Camera zoom / only part of the screen

Hello !! I would like everything in area1 (and all objects inside) to zoom in and out with the mouse wheel, but only that area, not the whole game, I have a menu on the left and right and it should always be 100%) Thanks for the help!!

You can put your menu Items on a separate CanvasLayer. Then when you adjust the zoom property of the Camera2D, it should scale only the objects that are in the menu canvas layer.


extends Camera2D


func _unhandled_input(event: InputEvent) -> void:
	if event is InputEventMouseButton:
		if event.button_mask == MOUSE_BUTTON_LEFT:
			var tween: Tween = create_tween()
			tween.set_ease(Tween.EASE_IN_OUT)
			tween.set_trans(Tween.TRANS_SINE)
			tween.tween_property(self, "zoom", Vector2.ONE * 5.0, 3.0)
			tween.tween_property(self, "zoom", Vector2.ONE * 1.0, 3.0)