Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I want to make a part rotate as a animation?

Asked by 6 years ago
Edited 6 years ago

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

Log in to vote
0
Answered by
xAtom_ik 574 Moderation Voter
6 years ago

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()
Ad

Answer this question