Hi
Here’s my problem: i have a working minimap in my tower defence project by using a secondary camera on top of my scene (see first image). This camera only shows the terrain but i calculate the position of certain elements in the scene (enemies, towers, etc) and show them with tiny icons. I also can move the camera by clicking on the minimap.
All this works perfectly but only if i keep my default resolution, if i change it these icons (or blips if you prefer) just move away of their positions. I know this is a common issue and i did solve it for the other gui elements by using GUI.matrix but in this case, it doesn’t help me.
Here’s some sample code that shows an icon in the relative position of a castle, mapCamera is my secondary camera and castleBlip is the small texture of the icon.
auxPosition = mapCamera.WorldToScreenPoint(castle.transform.position);
GUI.DrawTexture(new Rect(auxPosition.x - (castleBlip.width / 2), (defaultVerticalResolution - auxPosition.y) - (castleBlip.height / 2), castleBlip.width, castleBlip.height), castleBlip);
These images are the minimap and a screenshot of the game:


I imagine the solution must be really simple but i suck at calculating relative positions.
Regards.