How can i reliably and accurately position hitbox parts?

Hi, I’m making a fighting game and i was wondering what would be an effective way to position the hitbox correctly when and where it needs to be spawned at. I tried using PVInstance:PivotTo() so that the hitbox spawns in front of the player, which works, but gave inconsistent results in that when it is called while a player is moving, it is positioned incorrectly. I’m unsure if i’m doing something wrong here or if i have to use a different strategy. What can i do? Here’s the code by the way:

local pivot = player.Character.HumanoidRootPart:GetPivot()
hitboxclone:PivotTo(pivot * distance) -- distance is a number

Seems like a client-server problem, the server should be always behind the player.

Try seeing if you do it in a local script if it is smoother or not.

Solving it however Is a whole other story as networking by itself is complex.