Hello guys.
I have this script, but how can I make it so that it detects other parts, and not just a player?
while true do
script.Parent.CFrame = script.Parent.CFrame +Vector3.new(0.1,0,0)
wait()
end
script.Parent.Touched:connect(function(hit)
print(hit.Name .. " was touched")
end)
Thanks

6 comments
Your script is correct. I tested it and it does what you want.
Will it work for something moving? As in, moving using vector3
Well, maybe, but if you "teleport" part using CFrame its most likely won't work. And it won't work for anchored parts too i suppose.
That was the problem. Any way to do it with anchored parts?
If its a projectile that you're trying to make move consider using BodyVelocity instead of CFrame
Well, what I'm trying to do is when this part touches something, the part it touches becomes unanchored.