Moving things
Move parts with transforms, tweens, and physical velocity.
Part transforms specify position and orientation. Use direct assignment for immediate movement, tweens for timed interpolation, or velocity for physical motion.
Set a position
Position is the part center in world coordinates, measured in studs. Assignment
moves it immediately and does not test the intervening path for collisions.
Set position and rotation
CFrame stores position and rotation together. CFrame.Angles takes radians.
Transform multiplication applies the right operand relative to the left operand;
changing the order changes the result.
This example requires a part named Platform.
local part = workspace:WaitForChild("Platform")
part.Anchored = true
part.CFrame = CFrame.new(0, 5, 0) * CFrame.Angles(0, math.rad(45), 0)To move along the local axes, multiply by an offset:
local part = workspace:WaitForChild("Platform")
part.CFrame = part.CFrame * CFrame.new(0, 0, -1)LookVector, RightVector, and UpVector return the transformed unit axes.
Animate a property
TweenService:Create takes an instance, timing settings, and target property
values. It returns a tween without starting it.
local part = workspace:WaitForChild("Platform")
part.Anchored = true
local TweenService = game:GetService("TweenService")
local tween = TweenService:Create(
part,
TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
{ Position = Vector3.new(0, 20, 0) }
)
tween:Play()Pause retains progress. Play resumes. Cancel resets progress but leaves the
properties at their current values. Completed fires at the final endpoint and does not fire on cancellation.
Avoid assigning animated properties from other code during playback.
Apply physical motion
Set LinearVelocity in studs per second on an unanchored part. Physics continues
to apply gravity and collisions. Velocity does not move an anchored part.
Move a character
Humanoid:MoveTo requests walking toward a destination. It uses WalkSpeed and
collision handling. MoveToFinished reports whether the target was reached.
A blocked or timed-out request can fail.