I have a environment that I want to have a minimap, But I’m not sure how to go about this. I have a camera in the sky, pointing downwards, and a canvas in front of it, set to “Screen Space - Camera”. I would like to have this camera display dynamic info, concerning the location of gameobjects in the scene, preferably with the Image uGUI components, but how do I go about having the respective images atop their real world location?
seems like a fairly well rounded tutorial. Note that approach doesn’t require a top down “minimap” camera at all. One shortfall that that tutorial has is the “map” is a static texture, if you want you can setup an orthographic top down camera and render what it sees to a RawImage on the minimap’s canvas. You can then limit what it is seeing using the cullingmask option to just pick certain layers in the scene.
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class GetCameraTexture : MonoBehaviour
{
public Camera miniMapCamera;
public RawImage targetImage;
void Start()
{
miniMapCamera.targetTexture = (RenderTexture)targetImage.texture;
}
}