Im making a fighting game and I usually use touched events for projectiles then use region3/raycasting if I have the option. Im wondering if theres a better way to code projectiles since the touched event can be wonky
In my opinion, raycasting is the best way to do hit detection for projectiles. Heres some (pseudo) code to give you an idea of how to implement it.
local lastPos = nil while true do if lastPos then local ray = Ray(lastPos, projectile.Position) if HitPlayer(ray) then DamagePlayer() DestroyProjectile() break end end lastPos = projectile.Position end