im trying to create a setting in my game that lets you resize the window to a specific scale, but it is not working. here is my code:

func _process(delta):
      buy_size = $ScrollContainer/VBoxContainer/buy_window_size.value
      $"../Window".content_scale_factor = buy_size
      buy_w = 500 * buy_size
      buy_h = 300 * buy_size
      $"../Window".size = Vector2(buy_w, buy_h)

i tried printing some values and they all returned the right numbers, even doing print($"../Window".size) came out right at the end of the function, but the window itself does not change.

any soulutions? (godot 4.1)

Try this.

	get_window().size = win_size
	get_window().content_scale_size = win_size
	get_window().content_scale_factor = WIN_SCALE

    duane
    i tried:

            buy_size = $ColorRect/VBoxContainer/settings/ColorRect/ScrollContainer/VBoxContainer/buy_window_size.value
    	$"../Window".get_window().content_scale_factor = buy_size
    	buy_w = 500 * buy_size
    	buy_h = 300 * buy_size
    	$"../Window".get_window().size = Vector2(buy_w, buy_h)
    	$"../Window".get_window().content_scale_size = Vector2(buy_w, buy_h)

    i will also note the code i first used worked on a different computer