Part offset-ing differently in game than in studio?

So I am making a elevator for my game and ran into this problem where the elevator offsets itself more to the left but then when I activate it, it moves back to its location in studio.

Location in studio

Location in game

It is offsetted more to the left and I tried tweaking with the code but I can’t seem to find the problem.
Here is the code I am using:

local ProximityPromptService = game:GetService("ProximityPromptService")
local state = true
local Elevator = script.Parent.Parent.Parent.Parent.Parent.MaintenanceElevator1.Main

local function onPromptTriggered(promptObject, player)

	game.Workspace.MaintenanceElevator1.Main.Elevatorclose.ProximityPrompt.Enabled = false
	game.Workspace.MaintenanceElevator1.Main.Elevatorclose["Beep Sound effect"]:Play()
	task.wait(0.2)
	if state == true then
		game.Workspace.MaintenanceElevator1.Main.Elevatorclose.DownSound:Play()
	else
		game.Workspace.MaintenanceElevator1.Main.Elevatorclose.UpSound:Play()
	end
	task.wait(2.5)
	game.Workspace.MaintenanceElevator1.Main.Elevatorclose.LongBeep:Play()
	task.wait(1)
	game.Workspace.MaintenanceElevator1.Main["elevator move"]:Play()
	if state == true then
		for Distance = 800, 0, -1 do
			wait()
			Elevator.CFrame = Elevator.CFrame * CFrame.new(0, -0.05, 0)    
		end
	end
end

ProximityPromptService.PromptTriggered:Connect(onPromptTriggered)

Any help would be greatly appreciated.

1 Like

Nevermind, the problem was with the door tweening.