The info bubble
In a comic book, when a character says something, it's shown in a speech bubble. In many online social worlds, participants are represented by avatars and if you hover 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 the previous chapter), controlled by the LookMoveTo.cs
script. To add the info bubble, perform the following steps:
- From the Project panel, drag the
DefaultCanvas
prefab directly into the Scene view on top ofWalkTarget
underGameController ...
Get Unity Virtual Reality Projects now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.