- Home /
RTS Minimap Movement
I'm doing a rts game and I'm currently working on getting the camera working good.
Now, what I want to do is that when you click somewhere on the minimap camera showed on the screen then the main camera should move to that position.
How can I make this?
//Elis
I'd love to have this too. I'm surprised no one has created an interactive RTS $$anonymous$$imap script for sale on the Unity Asset Store, including left-click, drag, and right-click functionality. It's pretty much a necessity for RTS games, and I'd totally buy it. And it's absolutely impossible to find complete code for this kind of thing online. I'm finding a few different places online where people are asking similar questions, and they're getting/giving half-answers, so unless you're a coder, you can't use it. $$anonymous$$ind of frustrating. EDIT: I've since figured out how to do this. Not frustrated anymore. Ins$$anonymous$$d of looking for how to move a camera, I looked for how to move a regular object with a mouse click, and actually found good info. Once it worked, I swapped the object with a camera and Done. :)
Have you tried doing the obvious thing? Like checking where you click on the $$anonymous$$imap, transform those coordinates to world space coordinates, and moving the camera?
Baste, of course the theory behind what you're saying is "obvious." But when this is only your 5th day of ever trying to code anything, ever, in your entire life, the HOW is kind of challenging. But I'm learning.