.Touched() Event not working on anchored parts

I used lerp and all i want to find is the part which touches the blackhole

It wont work because the .Touched event wont get fired.
I tried ir several times.

If you’re not going to provide a sample of your code there is no way that we can help you.

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 event’s don’t work if both are anchored parts since they aren’t physically simulated. There’s a trick that works.

part.Touched:Connect(function() 

for _, part in ipairs(part:GetTouchingParts()) do
      if part.Name == "" then
              --> code
      end
end 
end)
6 Likes

Ill try it out. Thank you soo much.
So does this run in a continuous loop?
Heart this if yes.
Thanks.

1 Like

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.

It works but theres a problem. It only starts after i touch it.

THEY dont. I researched it. See it for yourself.

Touched event’s do work but both should not be anchored one can be anchored and one should not be, this is the solution to OP’s problem.

1 Like

Any idea?

Yes, and that’s how it works unfortunately.

1 Like

Thank you soo much. U have no idea how much you helped me.

Sorry, this is entirely false my guy. :slight_smile:

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.

3 Likes

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.

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.

This is true and what I meant. If one is not anchored, physics simulation!

3 Likes

Wait. So if i unanchor the eator, weld it to the black hole and use the :Touched evennt. Will it work?
Heart if yes.

It dosent work. I tried all types of welds.

Ok i found the solution.
I didnt weld but i made a hinge constraint between them.
It also provided a cool efect.
Thank you so much for replying.

6 Likes

Thanks, I was making an anchored part tween and trying to detect what is touching it. Strangely only the non-anchored parts were firing the .Touched signal.

1 Like