First-Person Controller

Make sure to take a look at First-Person Controller docs for the base asset first.

Networking

To network any of the built-in components from the base asset, simply right-click on the component to reveal the following menu:

At the bottom there's Setup > Network Components, by clicking on it the essential networking is setup automatically as seen below:

All what's left by now is to assgin this FPS Controller to PlayerPrefab in your NetworkManager.

Visuals

To add visuals that are visible to other players but not to yourself, attach them as a child of the Orientation GameObject, which is itself a child of your First Person Controller.

At this point, the visual should appear and behave as expected, but it won’t automatically enable or disable based on whether it’s the local player. To fix this, assign the Orientation object or the mesh you added to the PlayerObject field in the NetworkFirstPersonController component.

Locomotion

If your character uses animations, you’ll need to add the PlayerLocomotion component. This component automatically updates certain parameters in your Animator to enable and control locomotion animations properly.

Locomotion can vary greatly between projects. If the default component doesn’t fit your needs or the way you handle animations, you can always create your own custom implementation.

The PlayerLocomotion component directly plays Jump and Land animations without using transitions. It also updates the MoveX, MoveY, IsGrounded, and IsRunning parameters in the Animator based on the character’s current state.

Last updated

Was this helpful?