I wrote this code to make my game fullscreen and back to windowed during runtime in the script of my main menu. But it doesn't seem to work even when I press the key in Main Menu

In case you are unable to see the image here is the code:
func process(delta: float) -> void:
if Input.isactionjustpressed("FullScreen"):
if ProjectSettings.getsetting("display/window/size/fullscreen"):
ProjectSettings.setsetting("display/window/size/fullscreen", false)
else:
ProjectSettings.set_setting("display/window/size/fullscreen", true)