How to change project settings with code

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

Hi everyone!
In my project I have a portrait mode game while in one scene I want to make it in landscape made please tell me how to change project settings in code

:bust_in_silhouette: Reply From: timothybrentwood

Most project settings are only read when the project starts. This means changing them at run-time won’t apply any visible changes.

ProjectSettings.set_setting("display/window/handheld/orientation", "portrait")
ProjectSettings.save()

Restart the game and see the orientation has changed. Note that save_custom("filename") is the proper way to do this.

You might be able to accomplish what you’re trying to do using a Viewport:

is there any way to switch renderer inside the game ?

sanket | 2023-05-16 10:44

:bust_in_silhouette: Reply From: luislodosm

You can use:

OS.set_screen_orientation(value)

is there any way to switch renderer inside the game ?

sanket | 2023-05-16 10:43