Part.Touched Not Firing

Hey! My part.Touched isn’t firing.
I’m not sure why, no errors.

(The part is transparent until you touch it if that changes anything)

PLEASE HELP ME, It’s been hard to find help I need this done :frowning: :heart:

	local function createTween(object, transparency)
					game:GetService("TweenService"):Create(object, TweenInfo.new(3), {Transparency = transparency}):Play()
			
						Path3.Touched:Connect(function()
							print("Touched Path3")
						
						p4w.r1.CanCollide = true

							-- Tween Path3
							createTween(Path3, 0)
							createTween(Path3.Texture, 0.8)

							-- Tween p4w objects
							createTween(p4w.w1, 0)
							createTween(p4w.w1.Texture, 0.8)

							createTween(p4w.w2, 0)
							createTween(p4w.w2.Texture, 0.8)

							createTween(p4w.w3, 0)
							createTween(p4w.w3.Texture, 0.8)

							createTween(p4w.w4, 0)
							createTween(p4w.w4.Texture, 0.8)

							createTween(p4w.r1, 0)
							createTween(p4w.r1.Texture, 0.8)
					end)
						end
				end
			end)
		end
end)
end)

Thank you! I need help LIKE NOW SO THANK YOU!!!

5 Likes

Sure I can help. Be sure to mark this post as a solution if it helps

Modify your code to this:

local TweenService = game:GetService("TweenService")

local function createTween(object, property, endValue)
	local tweenInfo = TweenInfo.new(3)
	local tween = TweenService:Create(object, tweenInfo, {[property] = endValue})
	tween:Play()
end

local function handleTouch()
	print("Touched Path3")

	p4w.r1.CanCollide = true

	createTween(Path3, "Transparency", 0)
	createTween(Path3.Texture, "Transparency", 0.8)

	createTween(p4w.w1, "Transparency", 0)
	createTween(p4w.w1.Texture, "Transparency", 0.8)

	createTween(p4w.w2, "Transparency", 0)
	createTween(p4w.w2.Texture, "Transparency", 0.8)

	createTween(p4w.w3, "Transparency", 0)
	createTween(p4w.w3.Texture, "Transparency", 0.8)

	createTween(p4w.w4, "Transparency", 0)
	createTween(p4w.w4.Texture, "Transparency", 0.8)

	createTween(p4w.r1, "Transparency", 0)
	createTween(p4w.r1.Texture, "Transparency", 0.8)
end

Path3.Touched:Connect(handleTouch)
4 Likes

if your part’s CanTouch property is set to false then that’s why.

5 Likes

OMG TYSM IT WORKED! Just a question; what did you modify to fix it?

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.