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

How Would You Tween the Rotation of a Model?

Asked by 5 years ago

I've been doing some tweening already with individual parts and stuff, but how would you use tweening to rotate a model (with its primary part I presume)?

Here's the format I've been using for my tweening so far.

local TweenService = game:GetService("TweenService")
local part = script.Parent

local openGoal = {}
openGoal.Size = part.Size + Vector3.new(5,5,5)
openGoal.Position = part.Position + Vector3.new(0, 0, 10)
openGoal.Color = Color3.fromRGB(0,0,0)

local tweenInfo = TweenInfo.new(4)

local open = TweenService:Create(part, tweenInfo, openGoal)

open:Play()
0
openGoal.Rotation = part.Rotation + Vector3.new()... greatneil80 2647 — 5y
0
Rotation is not a valid member of model... corncob567 275 — 5y
0
@greatneil80 it is Orientation not Rotation xd Rotation is for gui OnaKat 444 — 5y

1 answer

Log in to vote
1
Answered by
qChaos 86
5 years ago
Edited 5 years ago

I'm pretty sure you can do this by setting the CFrame of the Model's PrimaryPart and then using CFrame.Angles for the rotation, I went ahead and made an uncopylocked game to show you how: https://www.roblox.com/games/3441522801/Tween-Test

0
I don't understand 60% of what you had in that script, but I was able to get it to work fairly well, so thanks. corncob567 275 — 5y
Ad

Answer this question