- Home /
display issues
Hi guys, could someone kindly explain this to me and help me fix this issue.
My problem is unity is showing me a different view compared to when I put it on my phone and play my game, I want to be able to see what it will look like exactly in unity how it will be on my phone I have uploaded images to show you what the background n stuff look like viewing it in unity then in the game.
(sorry if this has been asked before I couldn't find a solution - plus new to unity) thanks guys
How it looks on unity -
How it looks on the mobile -
Easy Way but only work for your type of phone go to the game view, click on the button that says free aspect, if you don't know your phones aspect ratio or resolution, research online then if you know it, find it in the given resolution and aspect ratio and if it isn't there click the + button,if it the resolution you know, enter the values otherwise click on the fixed resolution to change it to aspect ratio then enter the aspect ratio and that should make it fit the size of your phone but only youre type of phone.
Hi thanks but is there a way to fix this problem so we can see what it will look like on any phone or device without having to change the resolution all the time just want it to display or show us what it will look like in any device because at the moment we have to kee guessing. Thanks
Hard Way Works for all phones scaling using scripting, i believe like these this is c#
private float scalex;
private float scaley;
void Start(){
scalex= Screen.width/100;// Convert screen size in pixel unit
scaley=Screen.height/100;
Vector3 temp= transform.localScale;
temp= new Vector3(temp.x*scalex,temp.y*scaley,temp.z);
transform.localScale=temp;
}
That the least i can do it a very complicated process but now using this you can scale object to the screen sizes(not position(that somewhat more complicated))
I try to get the rest asap if you can find it
http://answers.unity3d.com/questions/30146/gui-texture-scale-and-position-according-to-the-ac.html
This article has many possible approach to this so i suggest this one than my one thought it a little bit complicated as i said before
sorry guys for some reason pics didn't show so I've posted them again 1st pic is unity and how it looks on it
2nd pic is exactly the same but how it looks on a mobile so is there anyway of setting up unity so it show exctly how it will look on the mobile, thanks guys
Answer by StewVanB · Jun 15, 2014 at 11:16 PM
I believe that this link will help you.
http://answers.unity3d.com/questions/618058/mobile-device-screen-sizes.html
Looks like what happened was the script is hard set for Landscape mode with this line:
float targetaspect = 16.0f / 9.0f;
So if you change this to:
float targetaspect = 9.0f / 16.0f;
It should get rid of the tallness.
I tried this out on my own mobile application and it only runs at the start. So build it out to some test devices and see if it is giving you the desired results.
Your answer
Follow this Question
Related Questions
Resolution in Android Games 1 Answer
Pick sensible resolution for FullScreen Mac App 2 Answers
Fixing screen resolution 1 Answer
Screen to view point? 2 Answers
What if the player sets resolution to higher than his monitor? 1 Answer