- Home /
Why doesn't Standalone Build Resolution settings affect the standalone size
I try to make a Mac standalone size of 512x384. So I go to Player Settings for PC, Mac & Linux Standalone. And Under Resolution I set Default Screen Width / Height to 512 and 384 respectively.
I build the app. But when I run it it is the same big size that it was when I previously built it with Default Screen Width / Height set to 1024 and 768 respectively. Why?
It seems that these setting don't have any effect. (And I do NOT want to use the Display Resolution Dialog)
P.S. I asked this is the forums but I never seem to get any help there anymore.
Seems like a bug to me, the only default screen values accepted are those that are displayed in the Resolution Dialog. If I input any other resolution, it keeps the previously correctly entered one. So yeah, only seems to work with the standard resolutions at the moment (4.2.0f4).
Someone on Google+ helped me. It was the old preference file interfering. After deleting it I was able to get the size I wanted so it is possible to get sizes that aren't displayed in the resolution dialog.
Answer by MorphVGX · Feb 03, 2014 at 09:25 PM
What solved the problem for me was:
[MenuItem("Edit/Reset Playerprefs")]
public static void DeletePlayerPrefs()
{
PlayerPrefs.DeleteAll();
}
Then, in the Unity Editor, go to Edit -> Reset PlayerPrefs.
Done =D
You can do it without the game/app running.
$$anonymous$$orphVGX - Perfect Answer! Been struggling with this off and on for a couple hours, tried like you said, and it works!
Thanks
I saw this same issue when setting 'Use Native Resolution' - it ended up being stuck at 1024x768. Using your snippet solved the issue for me. Gracias!
Write that code in a script in a folder called Editor. I think that is it.
using UnityEditor;
using UnityEngine;
public class Add$$anonymous$$enu : EditorWindow {
[$$anonymous$$enuItem("Edit/Reset Playerprefs")]
public static void DeletePlayerPrefs()
{
PlayerPrefs.DeleteAll();
}
}
Here's the full code - This script goes in the editor window
Im working on a mac and am having trouble finding the exact place to write this code. Could anyone give a specific location? (I'm still pretty new to all this so I'm probably missing something really obvious)
Answer by TokyoDan · Aug 16, 2013 at 02:17 AM
Note: I got help from someone in the Unity Community on Google+.
This is the answer I got and It fixed my problem:
"Is it possible that it's picking up preferences from a previous build of the app that was run with the resolution dialog enabled and 1024x768 was selected ? Preferences file lives in ~/Library/Preferences/unity...plist, maybe try deleting it ?"
I'm currently having the same problem. However, I can't find the preferences file. I've done a search for it and also have windows showing all hidden files and folders. I'm using version 4.3.0f4, so maybe things have changed. Or is this maybe a pro thing (I'm not using pro)?
Never$$anonymous$$d. The location in the above post is for $$anonymous$$ac. For Windows, preferences are stored in the registry. Here's a link explaining where: http://docs.unity3d.com/Documentation/ScriptReference/PlayerPrefs.html
I found the prefs folder and deleted it but that didn't fix the problem.
Answer by highflier · Sep 13, 2015 at 09:31 AM
Add these lines to the start of your program Playerprefs.deleteall(); application.quit
Then remove those line and run again. I am currently trying a to find a way to automate the process but this does work.
Your answer
Follow this Question
Related Questions
gui texture different scale in full screen game. 1 Answer
Built game, wrong graphics/ratio for standalone but working with WebGL 0 Answers
How to prevent unity from changing the resolution of my second monitor? (Standalone) 0 Answers
What's wrong with the aspect ratio in standalone build? 3 Answers
Portrait Resolution on PC Facebook Gameroom or WebGL 0 Answers