Hello there ?????. I have a problem triggering the touch event. I am making a parabolic arc using a part (see code:)
local Part1 = script.Parent.Part1
function getXVal(a, b, c, d, Yval)
return math.asin(Yval/a)*(1/b)
end
wait(1)
print(Part1.Timer.Value)
Part1.Timer.Value = 0
print(math.round(Part1.Position.Y) > 0)
repeat wait()
Part1.Position = Vector3.new(0,math.abs(30.5*math.sin((math.pi/44)*(5*Part1.Timer.Value+getXVal(30.5, math.pi/44,0,0,8.5)))),5*Part1.Timer.Value)
until math.round(Part1.Position.Y) == 0
Part1.Timer.Value = 0
if you are wondering what Part1 is, its the part I am controlling in this code. Inside the part contains a script and a number value called "Timer" and this is the code (changes the x value as if its in a graph)
while wait() do
script.Parent.Timer.Value += 0.1
end
I also have a part 2 code:
script.Parent.Touched:Connect(function(hit)
if hit.Name == "Part1" then
hit:Destroy()
end
end)
This code contains the touch event which doesn't seem to be working. If you have any ideas to fix it, please tell me

4 comments
So, first of all, Where is the script located at? There are two locations for the "Timer" value
The first script is located in the workspace
Also, the Timer value only has one location which is in Part1
By the way, I don't know if this will be helpful or not but it does'nt detect the part when it touches but it does detect the player when it touches.