Member-only story
Making a RTS game #40: Fixing our minimap (Unity/C#)
Today, we’ll continue working on our RTS and fix our minimap!
⬅️ Tutorial #39: Boosting our game scene | TOC | Tutorial #41: Preparing for a main menu… ➡️
📕 Get the ebook and bonus material on Gumroad!
🚀 Find the code of this tutorial series on my Github!

A while ago, we worked on our minimap and we even implemented some logic to move around a little indicator that shows our current main camera view zone.
Although it was a nice opportunity to discuss raycasting and dynamic mesh instantiating/updating, the thing is that this technique is pretty fragile and not the most efficient. If you start to have more “rocky” terrains or, just a hill somewhere, the difference between the flat FOV plane and the terrain itself will completely mess up the computation.
To fix this, today, we are going to completely refactor our minimap management system and instead rely on GL rendering to show the indicator on the UI minimap image. Then, we’ll see how to properly clamp the camera to the map and how to handle the “click and drag” camera re-positioning feature.