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

Why when I tween a part, It moves and ROTATES. Help?

Asked by 5 years ago

First of all, sorry for my bad english.

I'm kinda new to scripting and I'm trying to make a sliding door using tween. But there is a problem, when I activate the door, it slides and ROTATES.

I don't want it to rotate, only to move. Help?

Script:

local kcr = script.Parent local TService = game:GetService("TweenService") local d1 = kcr.Parent.Door1 local tweeninginfo = TweenInfo.new(

1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0

)

local d1Open = {CFrame = CFrame.new(-21.825, 12.017, 31.618)} local d1Close = {CFrame = CFrame.new(-21.825, 5.497, 31.618)} local Tween1Open = TService:Create(d1,tweeninginfo,d1Open) local Tween1Close = TService:Create(d1,tweeninginfo,d1Close)

kcr.Touched:connect(function(HIT) if HIT.Parent.Name == "Level-1 Keycard" or "Level-2 Keycard" or "Level-3 Keycard" or "Level-4 Keycard" or "Level-5 Keycard" or "OMNI-Keycard" then Tween1Open:Play() wait(5) Tween1Close:Play() end end)

kcr.Parent.KeycardScanners1.Touched:connect(function(HIT) if HIT.Parent.Name == "Level-1 Keycard" or "Level-2 Keycard" or "Level-3 Keycard" or "Level-4 Keycard" or "Level-5 Keycard" or "OMNI-Keycard" then Tween1Open:Play() wait(5) Tween1Close:Play() end end)

Note: The normal door orientation is 0, 90, 0.

Answer this question