Search Unity

UI Health markers with Vive

Discussion in 'UGUI & TextMesh Pro' started by Wattosan, Aug 17, 2017.

  1. Wattosan

    Wattosan

    Joined:
    Mar 22, 2013
    Posts:
    460
    Hello,

    I would like to have floating text over certain objects. This text must be seen through the wall (this part is done) and it must also preserve its size on the SCREEN. Not in world. Even though the text itself is part of the world.

    This is similar to World of Tanks or Xonotic's CTF icons. Video to Xonotic:
    . At the beginning of the video there is a marker "Red Base".

    I found quite a lot of solutions, including this one: https://forum.unity3d.com/threads/c...s-like-in-world-of-tanks.432935/#post-2800360.

    However, the problem is that if I try to do this with the Vive camera, things won't work. I set the Canvas to Screen Space - Camera and assigned the Vive's camera to it. Still on luck. Has anyone done this before? I tried adding the text to Worldspace, however then the size of the text gets smaller, the further the player is from it.

    Thanks!
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Screen Space - Camera should work. Make sure you've assigned the Camera field.

    If you want to use World Space, you can parent a canvas to the camera, not to the object. Then treat it like a screen space camera and position your object labels on it.

    Or use world space parented to the object and scale it by distance from the camera.