A potential mechanic in my game is that you can throw blocks at another player, knocking players back if the blocks hit them. The problem right now is that they’re way too unresponsive to feel good to play.
Right now the network works like this if Player A is hitting Player B with a block:
- Player A presses key to throw a block, sends position and direction info to server
- Server creates the block, sets its Network Owner to Player A, and sets its velocity to make it fly
- Server waits until the block touches a part, and if that part is a player (Player B), applies a BodyVelocity to PlayerB’s HumanoidRootPart to make them knock back
- Regardless of whether the block touched a player, server sets the block’s Network Owner back to nil
This system works smoothly until Player B gets hit. Between then, there’s a noticeable delay on Player A’s screen before Player B’s knockback, even with low ping. This is probably because the block’s Network Owner is Player A, but if that’s not the case there’s a really horrible sleeping physics delay.
Is there a good way to network this so it’s satisfying on both player’s systems?