I am trying to use a transform along with Camera.main.WorldToScreenPoint to have the game detect where the object is and use that to position the selection grid, but it will put it on the opposite side of the screen of where the object is in retaliative to the y position.
` void FixedUpdate ()
{
target = gameObject.transform;
point = Camera.main.WorldToScreenPoint(target.position);
// will make the menu appear if clicked on
if (Input.GetKeyDown (KeyCode.Mouse0))
{
if (Targeted)
{
toggle = true;
}
}
//this will make the menu vanish after the cursor leaves the object
if (Targeted == false)
{
toggle = false;
}
}
void OnGUI ()
{
if (toggle)
{
Debug.Log ("that tickles");
selectionGridInt = GUI.SelectionGrid (new Rect(point.x, point.y, 100, 50), selectionGridInt, selectionStrings, 2);
}
}
}`