BodyPosition lags and delays even though its on the client

I am currently working on a combat system and I use FireAllClients() for the pushback using BodyPosition which works fine when I am fighting NPCs but when other players are fighting NPCs it appears to be choppy and lag a-lot even though its not on the server.

2 Likes

In general, if a part is near an in-game character, its physics will be calculated by that player’s device; otherwise it will be calculated by the server.

— Network Ownership | Documentation - Roblox Creator Hub

No easy solution in general, but that page is a useful read.

I recommend one of these:

NPC.PrimaryPart:SetNetworkOwner(nil)

  • sets owner to server
  • probably no skips or jumps
  • might add delay to knockback even if its smooth

NPC.PrimaryPart:SetNetworkOwner(playerWhoHit)

  • sets owner to the player whos fighting the NPC
  • if you’re already the owner, no delay to knockback
    • (if you’re not already the owner, could see a delay while the ownership switches)
    • groups of players fighting the same NPC could get tricky
  • buttery smooth knockback for the owner (hitter)
  • skippy knockback (like you see now) for non-owners
  • need to call SetNetworkOwnershipAuto() eventually if you don’t want the hitter to be the owner forever
1 Like

so which one did you choose? im curious

The SetNetworkOwner(nil) option, I found it the most viable.