New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How can I stop my tween from changing rotation?

Asked by 3 months ago

I've made a door and am trying to make it smoothly open up and down with tweenservice, however I get this result: https://gyazo.com/53fca6551673d5b2d715f61570ee5e4d

local function tweenModel(model, CF)
    local CFrameValue = Instance.new("CFrameValue")
    CFrameValue.Value = model:GetPrimaryPartCFrame()

    CFrameValue:GetPropertyChangedSignal("Value"):connect(function()
        model:SetPrimaryPartCFrame(CFrameValue.Value)
    end)

    local tween = TS:Create(CFrameValue, info, {Value = CF})
    tween:Play()

    tween.Completed:connect(function()
        CFrameValue:Destroy()
    end)
end

frameupclose=CFrame.new(54.36, 15.591, 0.29)
frameupopen=CFrame.new(54.36, 24.791, 0.29)
framelowclose=CFrame.new(54.36, 5.541, 0.29)
framelowopen=CFrame.new(54.36, -5.459, 0.29)
db=false
button.MouseClick:Connect(function()
    if db==false then
        tweenModel(doorup, frameupopen)
        tweenModel(doorlow, framelowopen)   
    end
end)

Any way I can change the position without changing the orientation? Thanks.

0
Why don’t you change Position? OnaKat 444 — 3mo
0
^ And why you change CFrame OnaKat 444 — 3mo

Answer this question