I want to change this void to a wolrd space ui:
public void OnGUI(){
GUI.BeginGroup(new Rect(mapOffSetX,mapOffSetY,mapWidth,mapHeight), miniMap);
float pX = GetMapPos(transform.position.x, mapWidth, sceneWidth);
float pZ = GetMapPos(transform.position.z, mapHeight, sceneHeight);
float playerMapX = pX - iconHalfSize;
float playerMapZ = ((pZ * -1) - iconHalfSize) + mapHeight;
GUI.Box(new Rect(playerMapX, playerMapZ, iconSize, iconSize), “”, playerIcon);
float sX = GetMapPos(enemy.transform.position.x, mapWidth, sceneWidth);
float sZ = GetMapPos(enemy.transform.position.z, mapHeight, sceneHeight);
float enemyMapX = sX - iconHalfSize;
float enemyMapZ = ((sZ * -1) - iconHalfSize) + mapHeight;
GUI.Box(new Rect(enemyMapX, enemyMapZ, iconSize, iconSize), “”, enemyIcon);
GUI.EndGroup();
}
but I can’t think a method to do this, help me please