I’m trying to make a radar for a 2D platformer kinda game, it would be easy to just show whatever is close to the player, but the challenge is to show some of the level topology. So my basic idea and the fastest/easiest thing was to make a texture representing the level and move it inside a circular mesh or whatever (maybe a circular GUI? maybe circular mask for the texture?) My questions are, is there any way to make this? Is there any other (better) way to achieve this?
Thanx
Hi, welcome to the forum!
A useful technique for things like this is to use a separate camera to create the radar view. A camera has a property called Normalized Viewport Rect, which is the onscreen area it will render to (ie, its view doesn’t necessarily have to fill the whole screen). You can set up a camera to render to a small area of the screen, usually in a corner, and point it at anything in the scene. This is often used to create aerial map views of the gameplay, but it could just as easily show a textured plane or any other object.
The separate camera is an interesting idea. Can you show two different camera views at the same time? Can he put that camera view into a GUI object?
I am also new to both Unity and Scripting.
Thanks!
You can render a camera’s view to a render texture and then you can use it on an object or in a GUI or anywhere else you like. However, this requires Unity Pro. The other technique (with the normalised viewport rect) is less flexible, but works with the free version of Unity.