Can't zoom/pan my camera while a button is highlighted

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Deazy

Hello, I am making a game where I have a map and if I hover over a certain location a button will appear to click it. I already have a zoom mechanic and a pan/drag the map around mechanic. My problem is that whenever I hover over the button i can’t zoom and drag my camera anymore (I use RMB for dragging and scroll wheel for zooming)

I’d like to be able to zoom and drag even if my cursor is hovering over a button.
Please help, i can’t figure it out.

Here are is the code for the zoom and drag/pan:
This code is for the zooming:

export var min_zoom := 0.7
export var max_zoom := 2.5
export var zoom_factor := 0.1
export var zoom_duration := 0.2

var _zoom_level := 1.0 setget _set_zoom_level

onready var tween: Tween = $Tween


func _set_zoom_level(value: float) -> void:
 _zoom_level = clamp(value, min_zoom, max_zoom)

tween.interpolate_property( self,  "zoom",  zoom,  Vector2(_zoom_level,
_zoom_level), zoom_duration, tween.TRANS_SINE, tween.EASE_OUT)

tween.start()

This part is for the the dragging/panning:

func _unhandled_input(event: InputEvent) -> void:
      if event is InputEventMouseMotion:
	      if event.button_mask == BUTTON_MASK_RIGHT:
		      position -= event.relative * zoom
     if event.is_action_pressed("zoom_in"):

Then this for zooming again:

	_set_zoom_level(_zoom_level - zoom_factor)
if event.is_action_pressed("zoom_out"):
	_set_zoom_level(_zoom_level + zoom_factor)