How should combat physics be handled?

Hey there.

So it’s really quite difficult for me to learn how to handle physics in Roblox’s engine.I want to make a simple system in which damaging a monster knocks it backwards.Monsters are currently handled on the server and I’m unsure where to place weapon handling. If I do it on the client I create a more responsive click which doesnt suffer from delay. However if I was to let the physics occur on the client as well, I’d have to allow the client to control the mob’s position ithe game. This just doesn’t work in multiplayer.

On the other side of things, I could handle the physics on the server. A fairly simple loop of player clicks, attack animation plays on the client, server does a few checks to see what got hit (swing of a sword) and then applies the appropriate knockback effect. This runs the risk of feeling quite sluggish to the clients and I’m concerned about this. I want the physics to feel smooth, but I don’t know if it’s possible to get away without compromising player experience for security and consistency.

Any help would be appreciated :slight_smile:

2 Likes