how to make game pause if mouse outside viewport or game screen? i try to use this
but keep get return value everytime i move my mouse.
NOTIFICATIONWMMOUSEENTER
NOTIFICATIONWMMOUSEEXIT
this my current code. work and not work because need to - 1 pixel or more.
func _ready() -> void:
global_position = get_viewport().size/2
func _input(event: InputEvent) -> void:
if get_global_mouse_position().x > 1270 or get_global_mouse_position().x < 10 or get_global_mouse_position().y < 10 or get_global_mouse_position().y > 710:
get_tree().paused = true
global_position = lerp((get_viewport().get_mouse_position()),global_position,0.6)