Resolution problem!!!

Hi all,

Lets say I have a 3D Camera showing four cubes as walls, these are the boundaries of my game.

And now I’ve to show these boundaries on the same position as they are on the editor, for every phone resolution (Android and iOS both).

Please suggest me what should I do to achieve this.

I used this handy little script:

public class CameraAnchor : MonoBehaviour
{
	public Vector2 position;

	void Start ()
	{
		Camera cam = Camera.main;
		// Answer thanks to http://answers.unity3d.com/questions/481884/keep-gameobject-on-a-corner-of-the-screen.html
		transform.position = cam.ViewportToWorldPoint(new Vector3(position.x, position.y, -cam.transform.position.z));
	}
}

Which lets you set an anchor position on the screen. Setting position to (0,0) places it at the bottom-left, while (1,1) is top-right. Hope that helps :slight_smile:

This is useful: http://forum.unity3d.com/threads/78154-Supporting-Multiple-iOS-Resolutions-(iPad-iPhone4-3GS)

It would be done by a script that checks the screen width and height of the device it is running on in order to adjust accordingly.