I have a detection system in a bot which is supposed to detect players. How it works is it creates a massive invisible and non can collide sphere around the bot and then whenever this hits [DetectionSphere.Touched:Connect(function(hit)] a part with the name ("Head") it locks onto it and begins firing. For some reason this system only works sometimes, and after a lot of head scratching I decided that it must be something to do with the touched:Connect. (I have had problems with this in the past). My question is is there any better way to do this? I am not requesting that you write a script for me, just give me some guidance.
P.S. I have asked about this before and my script is here
https://scriptinghelpers.org/questions/78614/auto-firing-system-having-trouble-detecting-characters but it is really long and tends to scare people away from my question. I only want some pointers on how to correctly make a detection system, but if you really want to you can look at my script.
COMMUNITY QUESTION
What should I use instead of Touched:Connect? [Solved]
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Try using a loop with magnitude instead?
magnitude?
ok i will try
Thanks! This is exactly what I needed!