Rigid Body

self:set_syncer

Server

Assigns the peer that holds sync authority over the rigid body

Syntax

local status = self:set_syncer(
    peer_id
)

Parameters

TypeNameDescription
intpeer_idPeer 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

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Hand a rigid body to a connected peer
local entity = physics.rigid.create()
local peers = core.engine.get_peers()

if peers[1] then
    entity:set_syncer(peers[1])
end

On this page