I used to tween a part . when partA touches partB a function is to be done.
I use a print() to know the function is called or not . But no error or neither the function is called.
Is their is anyway to solve this
local partA = script .Parent
//Here I wrote the tweening code.
partA.touched:connect(function(otherPart)
if otherPart.Name == "partB" then
print("Worked")
end
end)
Does the parts has CanCollide property enabled?
is partB correctly named in workspace? no errors in output?
Could you show the entire code?
Test this one:
local TS = game:GetService("TweenService")
local partA = script.Parent
local goalCFrame = workspace:WaitForChild("partB").CFrame
partA.Touched:Connect(function(otherPart)
if otherPart.Name == "partB" then
print("Worked")
end
end)
TS:Create(partA, TweenInfo.new(3), {CFrame = goalCFrame}):Play()