Animatable Body
self:translate
SharedTranslates the animatable body by an offset in the parent's coordinate space
Syntax
local status = self:translate(
offset
)Parameters
| Type | Name | Description |
|---|---|---|
vector3 | offset | Offset to translate by as {x, y, z} |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = physics.animatable.create()
entity:translate({0, 1, 0})self:set_sync_to_physics
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
self:translate_local
Translates the animatable body by an offset in its own local coordinate space