World Object Location to Mini Map Location

Hey everyone!

So this one has been bugging me for a few weeks now and I still can’t find the solution…

  • I have a simple map that has instances of a Blueprint (let’s call it ‘Location_BP’) placed in the world space which are basically used to reference a world space location.
  • I then have a Mini Map which has been setup with a Scene Capture 2D class, so it captures the actual world space scene every tick and displays that through a UMG Widget. It also follows the Character around the map, so I am not displaying the whole map all at once in the Mini Map, only the amount allowed by the size of the Mini Map Widget and the height of the camera.
  • I would like to display an icon on the Mini Map over the location of each ‘Location_BP’.

I am having a huge amount of trouble trying to figure out how to get the real world location of the ‘Location_BP’, convert that to a 2D screen space location, and then adjust that location so that it sits over the ‘Location_BP’ displayed on the Mini Map.

  • Because the Mini Map Cam is capturing the world space scene, it would make sense to place the icon above the ‘Location_BP’ directly, but then how would I only display the icon on the Mini Map, and not in the world space?
  • Or is there a way to place another ‘layer’ over the map that can only be ‘seen’ by the Mini Map Cam, and would contain the icons?
  • Or is there a way to get the world space locations and divide them by the scale of the Mini Map, and then clamp them in the Mini Map?

I have tried all sorts of things and haven’t been able to figure this one out, so any advice/help would be greatly appreciated.

Cheers,
Logos

Up, also quite need this :slight_smile:

A response to this would be nice. I’m on the prowl for methods of doing this exact thing.

You could go either way. You could clamp position as 0.0 : 1.0 values for both X and Z Map scale and compare actor position against a point of reference in world than convert it to map clamped location. Or you could make a rendering component for the MiniMap actor and parent sprits to it, checking “Only Owner Can See” property, this would equire much less math involved. You’d have to just set sprite location = target actor location every frame. If I’d have to make a minimap, I wouldn’t render a top down camera, I’d go with a pre made texture and clamp locations relative to world’s center (0,0,0) instead. Much less resources intensive.

1 Like

Any chance you could elaborate on this? What do you mean X and Z map scale and clamped map location?

My spontaneous instinct would be to go with the third option and read out the locations on the map, convert it and add an icon on the minimap.

You could add a capsule to your character which has a radius as large as the area the camera captures. Then you get all your overlapping Location_BP’s, get their vector from your character to that location, throw away the Z axis and apply that vector in the correct scale to your minimap.

Alternatively you could also just apply world coordinates to your minimap (so it’s aware which area it captures) and directly provide the coordinates to it.

There are some optimizations to not use a lot of resources since you’re doing this each tick.

For example you should just keep an array of “Location_BP” actors and update them as you get the begin and end overlap events. Also not every marker moves probably meaning you can provide this as well meaning the none moving once don’t have to be updated but only moved exactly like the minimap.

Hi there, sorry for the question on a post that dates back to 2015 but could you please tell me how you can apply world coordinates to a minimap? When i click on my minimap, i would like it to display to location of where i am clicking in the viewport. For instance, if an object is located at x=5 and y = 5, then when i click on my minimap on said object, i would like for it to print the location x=5, y=5. I’ve been on this for days…