- Home /
Is this Possible to force gameobjects (coliders etc) to get stretched based on the aspect ratio of the screen?
Well with unity3D, I am in big trouble whenever I use sprites. As for textures I compensate for a evener look by Stretching it (Screen.width & Screen.height- that's fine for low end 2D games). Now If I have an Image and based on content of Image (Let's say I want to add BoxCollider for the walls in image). It works, but for only one aspect ratio. As I am making game for Android. I am having bunch of different resolution & Aspect ratios. Is this possible to stretch my coliders or other game objects so that I can Work easily???? please help me. I am in a rush :(
Seems like you can use Screen.Width or Screen.Resolution in combination with LocalScale to change the gameobjects.
If you don't care that all of your objects get stretched, then you can change the projection matrix of the camera to match any resolution:
http://answers.unity3d.com/questions/635701/screen-resolution-scaling-no-solution.html
will it stretch the gameobjects that are not visible accordingly as well???? I mean to say the colliders????
It doesn't stretch any of your objects or components. What it does is stretch the camera view to match the resolution. The game objects and colliders remain unchanged.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Combine Array of Sprites to Form One Sprite 0 Answers
Polygon Collider 2D Not Precise Enough 0 Answers
Image is crushed --- Sprite 2 Answers
Collision Detection in Capsule Collider 0 Answers