Here’s the issue: I have a circular minimap. On that minimap, I want to display objective locations. However, if you’re far enough away that the objective would normally be drawn past the edge of the minimap, I just want it to put a symbol at the edge of the map. Now, I’ve already got the trigger set up with the following code:
if((Mathf.Sqrt(((objPos.x) * (objPos.x)) + ((objPos.y) * (objPos.y)))) > 65)//if the objective is more than 65 pixels from the center of the map...
{
var bill = Mathf.Tan(objPos.x/objPos.y);
var x = Mathf.Cos(bill);
var y = Mathf.Sin(bill);
GUI.DrawTexture(Rect(x - 25,Screen.height - y - 25,50,50),HighObjectiveIcon); // draw the actual icon on the screen
}
EDIT: I’ve updated the code a bit (ignore the awesome naming conventions, I was in a rush, haha). This is CLOSE, but not exact. It now is correctly triggering and redrawing the dot as soon as it goes outside of the circle or comes back into it, but instead of leaving it at the edge, it just draws it in the corner of the screen, haha. Thoughts?