I’m trying to create a knockback for my combat system. Basically, the 3rd hit knocks the enemy back…
The problem is, I use BodyVelocity to get that knockback effect but it appears delayed when I attack another player. Occasionally, the target doesn’t even get knocked back for some odd reason.
This can be seen here
I’ve done some research and found that the issue can be resolved by utilizing NetworkOwnership. I used the target’s HumanoidRootPart as the BasePart since it’s the parent of the BodyVelocity and I set the network owner to the player. This fixed the delay problem I had but it created another issue…
As you can see here, on the left side, there seems to be some sort of latency compared to the right side. The player that was knocked back (on the right) felt “laggy” as I was controlling it. It turns out that whenever a player was knocked back, their client would feel kinda laggy while walking, and it only happens when I changed the network owner.
The knockback part of the script was mostly done on the server, I tried to put it in a local script but the movement wouldn’t replicate to the server.
Thanks in advance!