Android: changing object location based on device resolution

Hello,

I would like to make a game such that an object bounces off of an edge of the screen on an android device. The problem is that, due to the fact that android devices have different width/height ratio, the place where box colliders should be place changes based on the spec of the device.

So, my question is:

  1. Is there a simple/known method of handling this?
  2. If not, is there a way to check for what device the game is running on so that I can use if statements in combination with position methods to place the box colliders where they need to be?

Thanks!

Yes. It has nothing to do with Android or the device type, you just need to read Screen.width and Screen.height.