GUI MiniMap

Hi People!!

It’s my first post. First of all congratulations to developers for this great game engine.

Then questions… :smile:

I’ve got a complet GUI with buttons, boxes…

But one of this boxes must be a miniMap of the scene.

I’ve placed a camera with a render texture on the top of the scene. Pointing down. The result of the render it’s correct.

Then I attached this RT to a RenderTexture varieble on my GUI.

When play mode is on the result it’s something render, apperentlly the correct image, but it’s not render in colors, it takes the GUI background color, the result it’s not correct.

Somebody could tell, please, if I’m missing something?

Or how people does the miniMaps?

Thanks for all!

http://www.unifycommunity.com/wiki/index.php?title=Radar

Just need to adapt that for the map. I actually plan on playing around with a minimap this weekend some, the idea I have in mind is to have a camera above the character and render that to a texture, although this is a pro feature, so I was also thinking about taking one large image export of the level from overhead then using that and somehow using Unity’s 2D texture feature, only show the part the player is walking around on. Not sure if I can do this in Unity… yet… I know how to do this in regular 2d type programs, so just got some playing around to do. I am sure someone smarter than I can give you a quick example though.

I adapted the radar code on the wiki a bit into a class, so that I can utilize it a bit different, here is an image to show what I mean. I actually plan on having the thing laid out a bit different as I further tweak the code for my space game and my rpg that I am working on.

The bottom line is GUI.DrawTexture lets you do anything you’re likely to need.

Well thank you!!

I’m going to take a look at this.

Bye bye!

Well after looking I see that the problem is that it’s just rendered the alpha components on the minimap. But in addition all the terrain it’s considered transaparent (for this reason it’s not rendered). The minimap just render the water…

Sorry if it’s not so well explained, I don’t now any better way :frowning: But it’s understood the problem?

If somebody could help, thanks, if not thanks too :smile:

Bye


I discovered more, the terrain it’s the problem. If I create a cube, it’s show perfectly!!! But the renderTexture makes the terrain (the island example)
transparent

You need an active ‘snap shot’ of what you want to render. For this you need to have a camera take a picture of what will be rendered, to have this work smoothly the only thing that comes to mind is that the snapshot should be done post processing time, well simply put, create your level and take a top down picture of it. You can use another camera in a corner or what ever and just have it above the player at a distance and it will render. Just switch it to an orthographic view. This will probably give you the smoothest desired result.

Now, all objects need to be on different layers to get a cooler effect if you use this approach. For instance, your player on a player layer, enemies on an ememy layer, buildings on there own layer, so on and so forth.

Then you tell that camera to only render certain layers you want to have shown on the minimap. Like terrain and enemies along with buildings, but not vendors and the like unless you go into a building. This will allow you to have control over the render possibilities of the minimap. All depends on the end result you are looking for really.

If your terrain is of any size, you probably don’t want the camera to render the entire terrain for the map live anyway – that’s a lot of rendering for the map, and the view may not be what you want it to be anyway. What we did for WolfQuest was to offline render an orthographic view of the terrain (set up with a special scene and distance settings, etc.). You can then use that as a background texture for rendering the player and NPC markers on top of, or process it in Photoshop to make it more schematic and map-like.

That does not require Render Textures and it performs a lot better.