Creating the NPC canvas

The main differences between the canvas we will create for the NPC and that of the one we have been creating for the player are some of the configurations.

One of the main differences will be the Render Mode of the canvas. The NPC canvas will have a World Space Render Mode. This will allow us to position the canvas as another GameObject within the scene. The next important difference will be the Rect Transform attributes and, more importantly, the Scale and Rotation attributes.

Take a look at the following screenshot:

NPC health bar

To make life easier, all you need to do is create the canvas and change the properties ...

Get Building an RPG with Unity 2018 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.