I am trying to Move these two doors with Cframes with the use of CollectionService, I want them to slide open in the direction the red arrow is facing in the photo below:
Simply because you’re always moving it along the Z axis, so according to your video, the orange door must be along the z - axis hence the reason it works, to fix this you can find the left vector of your door and multiply it by 4. (You might have to change this depending on how you set it up if it doens’t work)
Here is the code that implements this:
ClickDetector.MouseClick:Connect(function(player) ClickDetector.MaxActivationDistance = 0
if Configuration.KeyCard.Value then
if player.Team == game.Teams.testing then
return
end
end
Sounds.door_open:Play()
TweenService:Create(CFrameValue, TweenInfo.new(1, EasingStyle, EasingDirection), {Value = CFrame.new(DoorLoaderModel:GetPivot().Position + DoorLoaderModel:GetPivot().LeftVector*4)}):Play()
task.wait(1)
task.wait(2)
Sounds.alert:Play()
task.wait(Sounds.alert.TimeLength + 1)
Sounds.door_close:Play()
TweenService:Create(CFrameValue, TweenInfo.new(1, EasingStyle, EasingDirection), {Value = CFrame.new(DoorLoaderModel:GetPivot().Position + DoorLoaderModel:GetPivot().LeftVector*-4)}):Play()
task.wait(1)
ClickDetector.MaxActivationDistance = MaxActivationDistance end)
CFrameValue.Changed:Connect(function(val)
DoorLoaderModel:PivotTo(val)
end)