Math is my biggest weakpoint in scripting, and this issue is really hurting me right now. I’m trying to make a knife throw that can kill players.
At first I just let the server handle the physics and hitboxes(bad idea), but now I want a smoother knife throw and lets the client handle ownership. But I’m having issues with detecting when the knife hits something.
On the client, I have the client rotate the knife(manually CFrame, I don’t know any math for a physics rotation thing) as well as raycast every frame to detect if the knife hits something. The problem is, my raycast isn’t consistent. Sometimes it works fine, sometimes it’s a little off, and sometimes it just doesn’t work.
Below is a gif of what I mean(grey line is the raycast)
I have no idea how to tackle this problem.