Skip to content

YaPendulumComponent

Beta
YaPendulumComponent controls an object in circular motion.

Functions

void Start()Beta
Starts the object a circular motion.
void Stop()Beta
Stops the object a circular motion.
number GetSpeed()Beta
Gets the spin speed.
void SetSpeed(number speed)Beta
Sets the spin speed.
void SetRotationAxis(float3 axis)Beta
Sets the target rotation axis.
float3 GetRotationAxis()Beta
Gets the target rotation axis.
void SetCenterPoint(float3 point)Beta
Sets the center point of the circular motion.
float3 GetCenterPoint()Beta
Returns the center point of the circular motion.
void SetTargetAngle(number angle)Beta
Sets the target angle to which the object moves.
  • angle angle of rotation
number GetTargetAngle()Beta
Gets the target angle to which the object moves.

Events

StartEvent<void>Beta
Triggered when the circular motion starts.
PauseEvent<void>Beta
Triggered when the circular pauses.
FinishEvent<void>Beta
Triggered when the circular motion finishes.

Code sample

The following code sample demonstrates how to make an object start a circular motion.

-- Prepares the component.
local pendulum = script:GetYaComponent("YaPendulumComponent")
-- Sets the center point to (0,0,1).
pendulum:SetCenterPoint(float3.New(0,0,1))
-- Sets the target angle to 1080 degrees.
pendulum:SetTargetAngle(1080)
-- Starts the circular motion.
pendulum:Start()