Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Convert World Space Size to size in Canvas

Discussion in 'UGUI & TextMesh Pro' started by tylkomat, Feb 8, 2021.

  1. tylkomat

    tylkomat

    Joined:
    Jun 17, 2019
    Posts:
    22
    I have a world space gameobject where different parts are marked with box colliders. On a UGUI ScreenSpace Camera Canvas I want to place other GameObjects at the corresponding positions of the colliders, scaled to the corresponding dimensions.

    I tried different solutions that I found, but in the end only this gist was working: https://gist.github.com/FlaShG/ac3afac0ef65d98411401f2b4d8a43a5

    Unfortunately it does not work for the size. The GameObjects get scaled way too large:
    scale-too-large.png

    It is supposed to look like this:
    scale-correct.png

    The size difference is 72 times. 60 * 1.2 (1.2 probably to inverse the scale of 0.8 of the World Space source)

    The question is now, can I keep this constant? It's a mobile application so screens may be scaled differently.
     
  2. tylkomat

    tylkomat

    Joined:
    Jun 17, 2019
    Posts:
    22
    no one?