Model
self:set_syncer
ServerAssigns the peer that holds sync authority over the model
Syntax
local status = self:set_syncer(
peer_id
)Parameters
| Type | Name | Description |
|---|---|---|
int | peer_id | Peer that receives sync authority: • When 0 - authority is handed back to the server• Any other value - must be the id of a connected peer, otherwise an error is raised |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
core.model.load("character", "models/character.glb")
local entity = core.model.create("character")
local peers = core.engine.get_peers()
if peers[1] then
entity:set_syncer(peers[1])
end