How to Use NPCs¶
To create NPCs, it is necessary to create an NPC Actor and add the Strix Replicator component.
The Strix Replicator component has several properties.
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 NPCs are not removed should the room owner leave the room.