How to Make NPCs

To create NPCs, it is necessary to create an NPC Object and add the Strix Replicator component.

The StrixReplicator component has several properties.

StrixReplicator on Inspector

Firstly, it is necessary to set Instantiable By to RoomOwner. It accepts two values:

  • RoomOwner - only a room owner can have the object replicated to other clients.

  • Anyone - any room member can have the object replicated to other clients.

The other property of interest is Connection Closed Behaviour. It should be set to ChangeOwnership. This tells Strix what should happen with the object when the connection is closed or when a room owner leaves the room. It accepts two values:

  • ChangeOwnership - the object remains in a game, but ownership is transferred to another room member.

  • Delete - the object is destroyed, as well as its replicas.

These settings ensure that NPCs are purely controlled by the room owner and replicated across clients. They also ensure that should the room owner leave the room the NPCs are not removed.