Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Place Button in a 3D world

Discussion in 'UI Toolkit' started by getmyisland_dev, Sep 16, 2021.

  1. getmyisland_dev

    getmyisland_dev

    Joined:
    Dec 22, 2020
    Posts:
    100
    I want to recreate a part of the UI from one of my favorite games.

    Its weird to explain so I just have a image here and there you can see these white floating icons for example the one one the doors or the one which says "Light Containment"



    These white shapes are button, because when you click on them you switch cameras or perform an Action.

    I don't really know on how to achieve this kind of 3D effect, where it seems like these buttons are placed inside of the world and they also keep their position in the world space, when you move, but they're rotating with you.

    I hope you could understand the thing I not please write a comment and I will try to help you, because I really want it. Thanks in advance.
     
    Last edited: Sep 16, 2021
  2. uBenoitA

    uBenoitA

    Unity Technologies

    Joined:
    Apr 15, 2020
    Posts:
    214
    Although UI Toolkit doesn't fully support 3D positioning right now, we do have some minimal utilities to place elements at the same position as 3D objects in the world, always facing the camera (just like you want). You can try your luck with
    RuntimePanelUtils.CameraTransformWorldToPanel
    .
     
    getmyisland_dev likes this.