Simple MLAPI Test

I wanted to try out MLAPI for Unity. Here’s a picture of the Scene I made running a Host (left) and Client (right).

I’ve posted the code to GitHub. Here’s how I made the Scene:

Download MLAPI
Assets > Import Package > Custom Package... > MLAPI-Installer.unitypackage > Import
Window > MLAPI > Install

GameObject > Create Empty > Rename NetworkingManager
Add Component > MLAPI > NetworkingManager > Select transport... > UnetTransport
Add Component > New script > NetworkGUI.cs

GameObject > 3D Object > Capsule > Rename Player
Add Component > Character Controller
Add Component > MLAPI > NetworkedObject
Add Component > MLAPI > NetworkedTransform
Add Component > New script > ThirdPersonController.cs
(Also add a Cube as a Visor to Capsule and set Box Collider off so it doesn't interfere with our camera)
Create > Material > Black > Add to Visor for cool factor

Create prefab of Player, drop in NetworkedPrefabs of NetworkingManager and set Default Player Prefab

GameObject > Create Empty > Rename PlayerStart

Note I couldn’t figure out how to tell how much data was being sent out on the network with MLAPI so I used their NetworkProfiler to estimate bytes per second sent/received.

Leave a Reply

Your email address will not be published. Required fields are marked *