You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to make a touch event work for a part…
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.
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
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
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.
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.