Forgive me, I forgot how to do this CFraming. Looked CFrame API… I forgot.
local RepS = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local ModuleFolder = RepS:FindFirstChild("Modules")
local Zone = require(ModuleFolder:FindFirstChild("Zone"))
local ModelDoor = script.Parent
local function doorfunction(model)
local DoorLeft = model.DoorL
local DoorRight = model.DoorR
local ToLeft = model.ToLeft
local ToRight = model.ToRight
local touchpart = model.DoorTouch
local debounce = false
local platform = Zone.new(touchpart)
platform.playerEntered:Connect(function(player)
if debounce == false then
debounce = true
DoorLeft:SetPrimaryPartCFrame(DoorLeft:GetPrimaryPartCFrame() = ToLeft.CFrame)
debounce =false
end
end)
platform.playerExited:Connect(function(player)
if debounce == false then
debounce = true
debounce=false
end
end)
end
doorfunction(ModelDoor)
What is “ToLeft” are you sure the CFrame is in the correct position? If that isn’t the issue could you send a small file with just the door and model you’re working with? Would be much easier to debug.
In order to Interpolate the Model, you either need to weld the model together, unachored all except the PrimaryPart, and Tween the PrimaryPart only, or grab the Position/Orientation of the Model, Interpolate them towards the Target, and Manually apply the new ModelPosition /Orientation.
GetPrimaryPartCFrame will grab the Models Current CFrame, SetPrimaryPartCFrame will apply the CFrame, TweenService only accepts Property changes, which for the Models CFrame as a property, you cannot access when scripting.