Skip to content

YaMovableComponent

Beta
YaMovableComponent Control the Entity's transform, etc.

Functions

void SetRotationEuler(float3 rotation)Beta
Set rotation for this entity
void SetRotationQuaternion(quaternion rotation)Beta
Set rotation for this entity
float3 GetRotationEuler()Beta
Get current rotation
quaternion GetRotationQuaternion()Beta
Get current rotation
float3 GetGlobalRotationEuler()Beta
Get current global rotation
quaternion GetGlobalRotationQuaternion()Beta
Get current global rotation
void SetPosition(float3 position)Beta
Set position for this entity
float3 GetPosition()Beta
Get current local position
float3 GetGlobalPosition()Beta
Get current global position
float3 GetScale()Beta
Get scale of this entity.
float3 GetLossyGlobalScale()Beta
Get global scale of this entity. Pay attention that this scale can be inaccurate due to shearing transform.
void SetGlobalPosition(float3 position)Beta
Set global position of this entity.
void SetGlobalRotationEuler(float3 rotation)Beta
Set global rotation of this entity.
void SetGlobalRotationQuaternion(quaternion rotation)Beta
Set global rotation of this entity.

Code sample

--Get movable component
local cmp = script:GetYaComponent("YaMovableComponent")
--Set position
local f3 = float3.New(0,0,0)
cmp:SetPosition(f3)
--Get position
f3 = cmp:GetPosition()
print(f3)