Search Unity

Unity UI Moving gameobject in world space toward UI icon

Discussion in 'UGUI & TextMesh Pro' started by Gamrek, Apr 16, 2018.

  1. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    164
    Hello,

    I am sorry if there is a solution in this forum already.

    I am trying make a gameobject to move toward a UI icon, like player collect an energy drink, and the energy drink in world space move toward the energy bar icon in overlay UI format. I am having a hard time to get the position UI icon for the gameobject to move toward to.

    I have tried Camera.WorldToScreenPoint or methods from RectransformUtility, but it seems can't find the right one to use. Can anyone help me out to point me to the right direction?

    Thanks in advance.
     

    Attached Files: