I am trying to make a door tween open when you touch a part, so far the part doesn’t even fire the function when it is touched. There is no warnings or errors in output. The trigger part has cancolid off, but that should not effect the touched, because that is on.
Here is my code (in full):
--//Services
local TweenService = game:GetService("TweenService")
--//Variables
local TriggerPart = script.Parent
local Door = script.Parent.Parent.DoorA
--//Tween Variables
local DoorTweenTime = TweenInfo.new(3)
--//Closed Variables
local doorClosedPosition = Vector3.new(261.875, 7.75, -50.75)
local ClosedGoal = {}
ClosedGoal.CFrame = doorClosedPosition
local DoorCloseTween = TweenService:Create(Door, DoorTweenTime, ClosedGoal)
--//Open Variables
local doorOpenPosition = Vector3.new(253.875, 7.75, -50.75)
local OpenedGoal = {}
OpenedGoal.CFrame = doorOpenPosition
local DoorOpenTween = TweenService:Create(Door, DoorTweenTime, ClosedGoal)
--//Functions
local function doorOpen()
print("Open")
DoorOpenTween:Play()
end
local function doorClose()
print("Close")
DoorCloseTween:Play()
end
TriggerPart.Touched:Connect(doorOpen)
TriggerPart.TouchEnded:Connect(doorClose)