2D UI in 3D space

Hey guys I was looking at “Deus Ex: Manking Divided”, and it gave me the idea for UI in my game. As you can see from this (1:00 for example) video they have some 2D images attached on the 3D objects (it looks like that to the player), when you move your camera in the game they stay at the same place. How could I recreate that effect in Unity? I was thinking that it’s maybe an Image attached to a world space canvas and it has a script on it to face the camera all the time but that’s not the case.

I don’t think it’s actually world space at all. I think what’s happening is that a raycast is getting performed, an object Adam can interact with is getting found (in this case a window he can open), and an equivalent WorldToScreenPoint calculation is getting performed to place the leader line as well as the image. All the UI elements are still screen space overlay.

Just use SpriteRenderer component in Empty GameObject. For texts use TextMesh.

To use this I would recommend a quad with a streched out canvas applied to it in worldspace mode.
The “look at” function should actually work for this too, make sure it is attached to the quad holding the canvas.
Then you could use Vector3.Distance to get the distance between player and the UI and decide how the scaling would work depending of how close or far you might be to the object (quad).

Hope you understand :slight_smile: