UI Image Follow GameObject

I know it is old but this can help someone

void OnGUI() {   
        var gotransform = Obj.GetComponent<Transform>();
        rt.position = mCamera.WorldToScreenPoint(gotransform.position);
      }
3 Likes