In a comic book, when a character says something, it's shown in a speech bubble. In many online social VR worlds, participants are represented by avatars and, hovering above someone's avatar, their name is displayed. I'll call this type of user interface an info bubble.
Info bubbles are located in world space at a specific 3D position, but the canvas should always be facing the camera. We can ensure this with a script.
In this example, we'll display the X, Z location of the WalkTarget object (set up in Chapter 4, Gaze-Based Control), controlled by the LookMoveTo.cs script. To add the info bubble, perform the following steps:
- From the Project window, drag the DefaultCanvas prefab directly into the Hierarchy window so that it's a child of WalkTarget.
- Rename it to InfoBubble.
- With InfoBubble selected, set the Rect Transform component's Pos...