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

Why isn't my tween rotating a door?

Asked by 3 years ago

I have a basic tween thing that is supposed to rotate a door model, but it doesn't do anything in it's current state.

It is not just the axis I am rotating it on, no axis seem to make a difference

The script:

local door = script.Parent
local clickDetector = door.Main.ClickDetector
local tweenService = game:GetService("TweenService")
local primaryPart = door.PrimaryPart

--tween stuff
clickDetector.MouseClick:Connect(function()
    local goal = {}
    goal.CFrame = CFrame.Angles(primaryPart.Orientation.X, primaryPart.Orientation.Y + 90, primaryPart.Orientation.Z)
    local t = TweenInfo.new(1)
    local tween = tweenService:Create(primaryPart, t, goal)
    tween:Play()
    tween.Completed:Wait()
end)

Answer this question