Networked

This page details the usage of the networked component on individual entities in PlayCanvas.


Overview

The Networked plugin allows local updates to certain properties of an entity's components to be sent to other connected avatars.

Transform

By adding the Transform component, an entity's position and rotation will be networked across clients.

Anim

By adding the Anim component, an entity's animation state will be networked across clients.

Networking Example

In this video, we have created an arena with a floor, four walls and a ball. The networking module has been added to the ball. After publishing and creating the world in VIVERSE, multiple players can join in the environment. The location of the ball is tracked across all player sessions.

To create the arena and ball in the video, you can follow the Create Your First PlayCanvas Project tutorial. The instructions below can be used to add Networking functionality to the ball or any other entity of your choosing.

1

Create the entity

A. We have already created the Ball entity in the tutorial linked above. Here's a screenshot of the Ball entity.

2

Add the Networking module

A. In the VIVERSE extension, select the Networking plugin for the Select plugins dropdown.

B. Change the dropdown to Transform in the Select a module and add field. Click the plus sign.

C. Confirm the enabled checkbox is checked.

3

Publish and create world

A. To test the project, publish to VIVERSE and create the world.

4

Share and play

A. Share the world link with another player and have them join the environment. We the other player interacts with the ball, you should be able to see the ball movement in your session. When you move the ball, the other player should be able to see the ball movement in their session.

Last updated

Was this helpful?