So I don’t really understand why there is such a difference.
My code uses a raycast to determine direction of the bullet and then it uses .Touched to do hit detection. However it apparently only works 1/5 times in game.
I think you should use raycast to also get the part to do damage, and only use the bullet for visual effects. I’ve been looking into this module called Fast Cast and deciding whether or not to use it in my game, here’s a link to it. Making a combat game with ranged weapons? FastCast may be the module for you! (Not sure if it’s good, so I don’t guarantee it.)
I wouldn’t rely on .Touched events for your hit detection. As someone mentioned before, you can emulate a physical bullet with a projectile based raycasting system like the FastCast module.
It basically works by casting multiple rays, where each ray serves as a sort of frame. In each iteration, it checks for a hit, it not, it calculates the rays position for the next “frame”, repeating this until it expires or hits something.