+2 votes

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

in Engine by (942 points)

2 Answers

+2 votes
Best answer

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")

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:

by (3,884 points)
selected by
0 votes

You can use:

by (318 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.