How to make game screen responsive to different screen resolution?

This is the view of game for browser version

and now this is in mobile version

Now how can I make my game resolution responsive to different screen resolution?

Thanks!

In your Canvas you’ll add a Canvas Scaler Component.
Then you will change the UI Scale Mode to Scale With Screen Size.

You have to put the Reference Resolution you work with, and then you have to change the Screen Match Mode to Shrink.

Try now adjusting the Game Scene Screen, or compile in your mobile.

I recommend change the Default Orientation to Landscape in the PlayerSettings (Edit>Project Settings> Player).

You should keep landscape view for mobile platform instead of portrait view.

For UI alignment issues across the devices, You should learn Canvas Scaler, Rect Transform

More info:

Designing UI for Multiple Resolutions

Unity UI Tutorial - Scale UI to the right size for every resolution using anchors

I hope, it will help you.

Cheers.

Check this out… for your resolution @JaamiParvez


private static float DeviceDependentScale

{
	get 
	{
		if ( Screen.width > Screen.height)
			return Screen.height / 480f;
		else 
			return Screen.width / 480f; 
	}
}

The only thing I’ve seen so far has to deal with canvases, on the side there is a canvas scaler and you set that to scale with screen size.

Aspect ratio plays an important role. The most common aspect ratios are 3:2, 4:3 & 16:9.

Adding this to your code will indicate a game to resize as per the screen sizes.

what about the sprites?