Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I want to make a part rotate as a animation?

Hello,

I want to make a sliding animation on a block but i want it to slide like a roation.

This is the script i using for the sliding part;

local TweenService = game:GetService("TweenService")

local part = script.Parent

goal = {}
goal.Position = Vector3.new(0,10,0)

local tweeninfo = TweenInfo.new(50)

local tween = TweenService:Create(part, tweeninfo, goal)

tween:Play()

Thats the script i using if i want a block to slide to the side but that wont make the part rotate.

Can someone help me with the script?

1 answer

In your goal, just set the orientation as well as the position.

eg:

local TweenService = game:GetService("TweenService")

local part = script.Parent

goal = {}
goal.Position = Vector3.new(0,10,0)
goal.Orientation = Vector3.new(0, 180, 0)

local tweeninfo = TweenInfo.new(50)

local tween = TweenService:Create(part, tweeninfo, goal)

tween:Play()

This discussion is preserved as it was. New answers, comments, and votes are closed.