Guest User

MinimapSize

a guest
Jul 30th, 2025
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class MiniMapSize : MonoBehaviour
  4. {
  5.     GameObject MinimapMesh;
  6.     public float ExtraSize = 0.5f;
  7.     // Start is called before the first frame update
  8.     void Start()
  9.     {
  10.         MinimapMesh = FindFirstObjectByType<MinimapMesh>().gameObject;
  11.         if (MinimapMesh != null)
  12.         {
  13.             float size = MinimapMesh.GetComponent<MeshFilter>().mesh.bounds.extents.magnitude;
  14.             GetComponent<Camera>().orthographicSize = size + ExtraSize;
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment