self:set_sync_to_physics

Client

Sets whether the animatable body synchronizes its motion to the physics step — enable this when moving it every frame from a script so it correctly pushes and carries other bodies


Syntax

local status = self:set_sync_to_physics(
    state
)

Parameters

TypeNameDescription
boolstatetrue to enable sync to physics, false to disable

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Enable sync to physics on a animatable body
local entity = physics.animatable.create()

entity:set_sync_to_physics(true)

On this page