- Home /
How to draw textures on a GameObject
What I am trying to do, is have a windscreen radar (plane) inside of the player's car. This radar will show other close by cars. The player's car is displayed in the center of the radar. My problem is that I do not know how can I draw blips representing the other cars. There is no fixed number of cars so I need to draw the blips dynamically when they get close to the player's car. How is it possible to draw as many textures as I want on the radar? I am using C#
Sounds like a job for unity 4.6 beta's UI system to me. In any case, your basic request involves:
find the relative position of each object you want to track
multiply this by a coefficient to scale down the distance as required
use this relative position as the location for a 'blip' object
instantiate new blip objects as needed, updating their relative position
destroy blip objects if they're no longer needed
my problem is how do I actually draw the blips on the radar, after I find the object relative position
A professional game would build a mesh where each blip would be a quad in the mesh. A simple solution is to represent each blip by its own Quad game object.
Answer by Steampunk_Droid · Nov 05, 2014 at 12:47 AM
I think this tutorial would come in very helpful... I know this is for making a minimap but you could easily change it to be used for a radar... using another camera in the scene that only draws to a texture and only sees what you want it to see (so you can set "blips" in your scene and make your main camera not see them but the other camera see only them) and apply the RenderTexture to your radar object :) I've actually followed this tutorial and it does work
Here's the link (remove the spaces https: // www. youtube. com/ watch?v=ZuV9Xlt-l6g
Answer by komodor · Dec 12, 2014 at 12:42 PM
there are different ways to make minimap, the most used is second camera from top, rendering just what you want in the minimap to render texture, which is used on the minimap object
to render just something use culling mask
http://answers.unity3d.com/questions/20676/how-do-i-create-a-minimap.html
http://forum.unity3d.com/threads/advanced-minimap-tutorial.169401/