The Touched event is the monster hiding in my closet and my sleep paralysis demon. I was told many years ago that Touched isn’t accurate and should never be used. Since then, I’ve avoided it like modelers avoid high poly.
Shedletsky made a post about how Touched likely works, and it seems well-optimized. After all, Roblox is a physics engine. If I had a specific case like player-bullet collision, I would want to write my own system, but otherwise, the big question remains: Does Touched reliably work for general purpose collision with high precision?
If we are talking about the regular run of the mill stationary Touched instance then yes it should work without any game breaking issues. One of the issues that I faced with the Touched event is the inaccuracy when it comes to moving parts, even more with high speed moving parts. Recently I have moved over iterating through a selected area I created for “living” things, I find the distance from my Character to the object which determines if I am close enough for it to be touched/hit. I currently use this for combat in my projects, there is probably a better way but its what I use at the moment.
Actually, I experimented with moving parts. I set a server script so that it would anchor itself if it was touched. It turns out that unless your ping is 0, the part will freeze in midair on the client side. So the best option with projectiles is to set the network owner to a client
When I use it, it’s worked well for me.
But that’s probably because I avoid it in cases that it wouldn’t work fine.
I have anchored parts being CFramed around every frame. Touched doesn’t even fire if they get CFramed through each other. Instead, I hook the Touched event for the sake of creating a TouchInterest, disable CanCollide, and use :GetTouchingParts() every 0.1 seconds to do my own touching calculations. That works perfectly for my specific use case.
So basically tinker around with touched to see if it can be utilised in what you are planning on making OR create your own system to obtain a more accurate results in the event that touched cannot be utilised.
Yup. It can handle about 25 projectiles before it starts to misbehave slightly as things that touch briefly might not get caught, but that’s due to all the other slow things involved with the projectile code (I think?).