Touch event not firing

Hello developers for some reason my touch event will not fire at all


I am completely stumped here my cantouch value is true the only thing I can think of is my part is a meshpart and its being tweened at the same time. Anybody know what the issue could be?

2 Likes

Are you purposely checking if the hit parent doesnt have a humanoid?

4 Likes

The word “Humanoid” has to be capitalized correctly. You typed in “humanoid” when it should be “Humanoid” and also you added the keyword “not” which even if you spelled it correctly, your code would only run if the part’s parent didnt have a Humanoid (@astraIboy noticed this).

Here’s what you typed:

if not hit.Parent:FindFirstChild(“humanoid”) then

What it should be:

if hit.Parent:FindFirstChild(“Humanoid”) then
3 Likes

Though you are correct it still does not print the first 1

Try removing the “not” out of your if statement (credits to @astraIboy for pointing it out at first). Unless you’re not trying to detect a Character, then disregard this response.

2 Likes

Its still not doing anything and I am trying to insure it is not a humanoid

Are you sure that you have CanTouch and CanQuery on in the part’s properties

image

2 Likes

image

1 Like

Try printing the part that collided’s (hit) name. See if the parent is colliding or if it’s the child.

You seem to include “spike” which would usually be just one part (at least I think), so if it’s the spike that’s colliding then you could change it to

not hit:FindFirstChild(“Humanoid”)

instead of

not hit.Parent:FindFirstChild(“Humanoid”)

Same outcome i am not even getting an error either

Can we see the SmallSpike heiarchy and also a screenshot of all the parts attached to it

1 Like

image

Is the “Spells” folder in ReplicatedStorage? If they are, Scripts won’t run in ReplicatedStorage (doubt this is true but still making sure).

Are you certain you are touching the correct one? You have 2 named the same. Could be the issue.
Try renaming them to by adding 1 and 2 at the end and checking then.

Edit: 4 AM and I can’t read. I thought both are named Spike lol
Edit2: I mean Base :man_facepalming:t2:

1 Like

The script is in a tool that clones the part from rep

Can we see how your bringing the cloned spike into workspace aka the code for when you clone it from rep storage



I have a feeling the function is the problem

Yeah, if it’s being brought into workspace via localscript and your script is detecting it via the server; that may be the reason it’s not firing.

I gtg soon… so sorry if I don’t respond :sweat_smile:

1 Like

It’s okay if you leave thank you for the help

Do you mind printing before the .Touched function?
print(Base:GetFullName()) and make sure it’s the correct one you’re trying to touch?
The problem isn’t that it’s on a LocalScript.