Networked player character

Go ahead and drag the player prefab you have created into the scene. We will use it as a base to create a new prefab, which will be used for the networked version of the game.

Go ahead and remove the existing BarbarianCharacterController.cs and BarbarianCharacterCustomization.cs components from the instance. We will create new scripts that are network-enabled and use them. Rename the PC GameObject instance to PC-C6-Network. Now make a prefab of the instance. You should now have a new prefab named PC-C6-Network.

Go ahead and attach the following components to the prefab: NetworkIdentiy, NetworkTransform, and NetworkAnimator, by using the Inspector Window and selecting Add Components | Network | <component name>

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.