Static Body
self:set_syncer
ServerAssigns the peer that holds sync authority over the static body
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
local entity = physics.static.create()
local peers = core.engine.get_peers()
if peers[1] then
entity:set_syncer(peers[1])
end