Floorplan as minimap

I had a look at my project but there isn’t really an easy way to share exactly how it works in my project. You can download the project from the marketplace.

The general idea is that you have a version of your buildings drawing in the level on a plane that is exactly aligned. You can get the extends (min / max position) of that plane and you can also get the position of the player. Now you can calculate the player position relative to the plane position. For example if the player is exactly in the middle of that plane the relative position of the player would be 50% (or 0.5) in both X and Y direction.

When you place your mini map into a widget you can get the screen position of the mini map. All you need to do is place the icon of the player exactly in the middle of the drawings on screen in our case.

You can use a Linear Interpolate Node which has 3 inputs. A, B and alpha. A would be the min value of the screen position and B would be the max value of the screen position. Alpha would be the relative value: 50% would be 0.5 in our case and the result would be exactly the middle between the lowest and the highest point of the minimap on screen. That’s the general idea how you place your player icon relative to the player position in the level.

You need to do the calculation on the ‘Tick’ Event in your widget. You need to remove the player icon and then place it again on the updated position every ‘tick’ which means roughly every time the game renders a frame.

Hope that helps.