TouchInterest not being created/Touched event not working

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to make a touch event work for a part…

  2. What is the issue? Include screenshots / videos if possible!
    The issue is that the game isn’t registering my touched event with a part, the part has can touch on and the character touching it is a custom StarterCharacter (not sure if that could be the issue here), I noticed that the parts aren’t even getting a touch interest created which leads me to believe something is preventing the touched event to register.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    So far I’ve tried make the script server sided, client sided and moving it out of the module it’s currently in. I’ve searched throughout the dev forum however I’ve not seen anything helpful, @010DevX101 has also had a look however he has no idea either lol. The script is getting all the zones properly, I used a print statement to check if it’s getting the zones under the folder, and it is, it’s just not registering the touched event at all, not even creating a touch interest for the parts.

Below is the script I’m using.

for _, Zones in pairs(workspace:FindFirstChild("StateZones"):GetChildren()) do
	if Zones:IsA("Part") then
		Zones.Touched:Connect(function(Hit)
			print("Touched")
		end)
	end
end

Screenshot of the layout:
image

It has the CanTouch property…
image

4 Likes

I’m not sure what can query does but I think it can fix that.

Have you tried creating them manually?

maybe try turning can query on

I dont think if that is the issue

Collection service would be a good alternative. I can’t really find a solution now since I’m on mobile.

Also make sure they’re archivable, because if they aren’t, scripts can’t identify them.

You cannot manually create Touch Interests

Yep, they’re archivable but the issue persists

It is likely that your

is not built right. Maybe try to use it without the custom StarterCharacter, and see if the touch event is registering it?

CanQuery doesn’t effect touched events, I also tried it and it doesn’t effect the outcome

The issue is, I’ve tried removing the StarterCharacter and the issue persists, it’s not creating the touch interest, which means it isn’t even registering the Touched event

Huh…

One thing though, is the part anchored? Because according to the image you provided, it seems to have CanCollide disabled.

The parts are anchored, can collide is off as it’s just a detector. Can collide isn’t needed for touched events however.

Try to add another part in the workspace(and add a script that directs to that part with the Touched signal), and just anchor it, disable CanCollide, and CanQuery. Let me know if it works.

Yeah that worked for some reason, not sure what the difference is between the two as both should be working the same as they both have the same layout.

Maybe remove

and try again. I don’t think this would affect the for do loop.

Yeah that wouldn’t change anything, I just added a script to the normal zone part and that seems to be working/creating the touch interest.

I’m gonna try and just create script under each zone and see if that will work.

I don’t recommend you to use touch events, as these are somewhat buggy, either they don’t detect the touch, or they detect it and call it multiple times, which can cause bugs in your script.