Hi, total noob here.
I'm trying to make a script that, when you push a button, the window gets bigger to fit your screen and then enters fullscreen.
When I try pushing the button, the instance immediately stops responding and I get the error message aforementioned in the title.
func _pressed() -> void:
print("Button clicked")
var paranoiaZoom = Vector2(DisplayServer.window_get_size())
while(paranoiaZoom < DisplayServer.screen_get_size):
paranoiaZoom = paranoiaZoom*2
DisplayServer.window_set_size(paranoiaZoom)
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)```
`while(paranoiaZoom < DisplayServer.screen_get_size):` seems to return the error.
I have no prior knowledge of GDscript or C#/C++ or anything, and no clue what I'm doing