I made a code for a black hole in which it detects any objects that are touched to it and pulles them to the middle.
I found out that the .Touched event doesn’t work on anchored parts.
And many of the parts that i want to pull are anchored.
I have absolutely no idea how to get the part.
I cant. Its took me very long to make that code and i dont want to just display it.
All i can say is that it first has the .Touched event at the start of it
eater = script.Parent
eater.Touched:connect(function()
if humanoid then
--- lerp to black hole
elseif part then
--- lerp to black hole
--- check if anchored and anchor
end
end)
All i need to find is how i can find touched anchored parts
Touched events do work on anchored parts, this is not the solution to the OP’s problem.
You must be doing something wrong if your touched event is not working properly, and in order to figure this out, you’d need to provide some code for anyone to help you.
Edit: Touched events work between any anchored part and at least 1 unanchored part, not two anchored parts. I assumed this was involving at least 1 unanchored part because more often than not, 2 anchored parts would not be moving.
If you insist on using 2 anchored parts, at this point, you may as well be using Raycasts, but that solution would be a lot more complex than using unanchored parts and touched events.
You see, they do work whenever anchored or not, it depends on the physics and motions it has on Roblox Studio and the Engine itself. @TheFurryFish is right here and your solution makes it harder and not the quick answer to the OP, unfortunately, also be nice next time.
Here is a quick demo on an un-anchored and an anchored part:
I don’t have the true answer, but there shouldn’t be any code whatsoever as physics does it stuff whether unanchored and anchored.
The overall reason why i wanted the answer was because i wanted a part to register and anchored’s part. In the video YOU touched the part. Thats not what i want.
And sorry if we seemed harsh.