im totally lost here…
http://img41.imageshack.us/img41/5498/unity1.jpg
as you can see, i got a minimap going on in the upper corner wich works great and all, just had a second camera put up and scaled it as you can see in the inspector,
my problem is that i want people regarding of resolution to have the same SIZE of the minimap window, and only the locations move accordingly,
but when i change screensize this happens
http://img96.imageshack.us/img96/5171/unity2.jpg
it gets all thin (reacts same way in a build and)
i want a fixed size, but the placement will have to be the upper right corner always, so 800x600 and 1920x1080
will have same size of minimap (like the way GUI reacts to screen size change)
thanks alot in advance you will really save my butt if you can get me out of this mess!
-Martin
In your Normalized View Port Rect, the X axis needs to change as the size of the screen changes. I’ve never done this in code (and I’m at work right now so I have to make this quick!), but here’s how I’d do it off the top of my head.
function Update() {
//var fl_screen_width = current width of the screen
//var fl_map_width = width of your minimap
//ViewPortRect.x = fl_screen_width / (fl_screen_width - fl_map_width);
}
i have NO coding experience what so ever mate
i dont understand how where and what to do with that script
a guide maybe? and where to get the numbers to put in and where to put the script?
thanks in advance
also i get this error
Assets/NewBehaviourScript.js(6,1): BCE0005: Unknown identifier: ‘ViewPortRect’.
I’ve got a lot of coding experience but I’ve never coded a minimap, and after a quick search I couldn’t find “ViewPortRect” either. Like I said, I’m at work right now; I’ll see what I can figure out for you tonight!
sounds great mate! thanks alot!!
really one of the last few things i need to get startet hehe… been bugging me alot
hope to hear from you later
-Martin
Hey Martin, it took a while but I figured it out!
var fl_map_width = 220;
var fl_map_height = 220;
function Update() {
var fl_screen_width = Screen.width;
var fl_screen_height = Screen.height;
camera.pixelRect = Rect(fl_screen_width - fl_map_width, fl_screen_height - fl_map_height, fl_map_width, fl_map_height);
}
- Save this code as a script in your project.
- Select your minimap camera in the Hierarchy, and drag this script onto the minimap camera.
If you want to change the height and width of your minimap window, there are variables in the Inspector (after you follow those 2 steps above).
Let me know how the script works for you!
BrettFromLA
your script dont work for me 
it works only when i disable the camera from the firs person controller
please help
You need to set the depth property for the minimap camera higher than the main camera (say, if the main camera’s depth is 0, set the minimap’s to 1).
i have that i have to remove the main camera and add a normal camera but it works now 