Hello I tried to make a SCPF door by using tween service but it is changing always the oriantation how can I fix this?
https://gyazo.com/97fb56adb2d2600068b90a5016741d97
My script:
local door1 = script.Parent.Door1 local move = script.Parent.DoorMove local debounce = false function open() local tweeninformation = TweenInfo.new( 4, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0 ) local pos = {CFrame = CFrame.new(move.Position)} local tweencreate = game:GetService("TweenService"):Create(door1, tweeninformation, pos) tweencreate:Play() end script.Parent.KeyCardReader1.Touched:Connect(function(Handle) if Handle.Name == "Handle" and script:FindFirstChild(Handle.Parent.Name).Value == true then open() end end)
The problem here is that your target CFrame is a position only CFrame that doesn't take into account the door's current orientation.
You can fix this by making sure that your target CFrame is relative to the door's starting CFrame, meaning, a CFrame that's translated a few studs to the... right, since I'm assuming you want it to slide.
There are a ton of guides about CFrames out there, but I think the *
constructor part in this is what you'll need.
Hope that helps!