- Home /
Detect sign on Fix Mini map,When click on moving map,just like pin point
" />
My Image Here : http://freeimagehosting.net/tdtv8
I am making a new function,(Silimar function to dota(warcraft) pin point on the map)now > i have scene that is split into half,left side is fix island map,where right side is for helicopter flying in the island,
Is there a way to make This>
i wanted to make it that when i mouse click on a location or an objects on the right side island map,its will display a pin point signal on the fix island map on the left side
So that we will be able to know wheres the location of the helicopter now.Can someone kindly help me with this Thx.
(For those who know dota(Warcraft))This function is similar it,like when we mouse click on the map,it will display a signal sign blinking on the mini map.
Answer by Lo0NuhtiK · Jan 10, 2012 at 10:07 AM
What I think you're wanting to do would take quite a bit of stuff if you did it the only way I can think that I'd do it at the moment.
Probably a better way than this, but if I did it right now I'd use a plane object set beneath the terrain and sized out bigger than the terrain with your 2Dtexture map used on its material ; a separate camera for the minimap with it's layers and depth etc set and positioned to where all it showed was a top-down view of that plane ; then other gameObject(s) made for the map 'blips' that could be instantiated at the x/z of the raycast-hit's of the mouse click (and above the plane on the Y-axis) and set to the minimap camera layer so it could only be viewed on the map and ignored in the rest of the game. ...stuff like that. Don't know, haven't tried it, and haven't searched for anything like it.
Be even easier if you used a 3D minimap (overhead camera) of gameplay area instead of a 2d texture image for it ... basically the same, but less the extra plane and stuff.
Have you searched the forum?
For my map i think i have a mainCamera above the Terrain,by caturing it and displaying as a fix map,so i dunno is 2D or 3D anythings lol,so this is displaying on left half of the scene.
on the right side is another camera attached to helicopter,so is half half.
on the forum i hardly see any similar to my function or i am unaward of it,think these one,but i dunno how to use it on myone,one of it is this,references>
http://answers.unity3d.com/questions/25178/$$anonymous$$i-map-radar-screen-with-different-blips.html
LoONuhtik you can check my Image here : http://freeimagehosting.net/tdtv8
So i want it to be when i click on right side map,the fix map on left will blink to show where am i now
I didn't type the html on your other topic, just use the add-image button on the answer post thing or whatever to post your images.
Edit : oh, never$$anonymous$$d lol looks like you got it now :D
yea,So after u looking at my image do you have a clearer view and now do you know what i want??or have u figure out how to solve my question?
Yeah, it's basically what I figured you were trying to do, my answer remains the same though. You could do it something like what I posted, or the ways that the other $$anonymous$$imap topics I saw you bump today describe. Those are along the same lines as what I said, sort-of I think, from what I saw skim$$anonymous$$g through them.
You just have to make it all work how you want it to.
Answer by by0log1c · Jan 11, 2012 at 07:07 AM
Lo0Nuhtik's answer is interesting. My own first idea looked like this:
- Setup a plane with the map texture. TopView and match it with the 3d world under it.
- Find X,Z of all 4 plane corners. We now have an equivalent rectangle in 3d space.
- Delete the plane. Remember all 4 X,Z positions!
- Use GUI.DrawTexture() to draw the texture. Figure its 4 X,Y positions.
- Make a function that takes X,Y position and if within our texture rectange, returns percentage.
- Make a function that takes X,Y percentage position within our 3d space rectangle and return true values.
That was setting up, now for the actual "map blips":
- When user click over the texture rectangle, get the mouse position percentage within it.
- Convert that over to our 3d space rectangle.
- Raycast in 3d space using our new X,Z from far up, straight down. Read hit.point Y.
- We now have a close approximate of the 3d position relative to its texture.
- Instantiate bleep GameObject using our X,Y and the new Y from the ray hit.point + offset .
This is only a theoric step-by-step but it could give you another work angle idea. Basically our first step is setting up 'equivalent rectangles' to switch positions between 2d and 3d using relative positioning (percentages%).
OOPS: this actually 'set waypoints in the map, display them in world' and not 'display my position on the minimap'. The concept could still be used with little modification to work the other way, and requires no additionnal camera... but yeah, it might be farfetch, its just an idea.
woa,acturally this not yea complete game was create by my senior and now my $$anonymous$$cher tell me to improves on it,i am a totally new in this and having hard time understanding all this LOL.maybe i will think a easy way to do.
maybe i will create a sphere and left it on top of the map,so may i set at start the render.enable=false.so when pin point it will be true at using this GameObject.Find("Cylinder").transform.position = new Vector3( helicopter.transform.position.x, 2000, helicopter.transform.position.z);
Your answer
Follow this Question
Related Questions
Mesh missing from mesh filter after copy the whole folder to another com 1 Answer
Freezing camera 1 Answer
Importing to Unity from Blender questions 1 Answer
Cutout material in mobile platform 0 Answers
Help with OnTriggerEnter Issue 1 Answer