Whats the best way to handle animations for combat game?

Hey! im scripting my first combat game including katanas, i wonder whats better to handle animations, server or client? Im also using raycast hitboxes that depends on animation and i use animation :GetMarkerReachedSignal() event to start and stop hitbox.

From what I’ve read, animations on players should be done locally. This however, also means that creation of the hitboxes is done by the client too, which can cause the ease to hack on that game.

Honestly, to avoid the ease of creating cheats, I’m not sure what you should do here, but it shouldn’t be too hard to script an anti-cheat for the animations.

Good luck making your game! (Btw I love good sword combat games like SB2, they’re just fun)

i guess best thing i can do is move hit detection to client and do sanity checks as u said

Recently had the same question, what I did is handling animations in the client (so players with high ping have a smooth experience) and some basic cooldown, I did the rest in the server: hit detection, damage and the more advanced cooldown.
It’s also a good idea to do sanity checks as you said :slight_smile:

i would handle only animations on client but my hitbox is based on animation events so i cant do that

Client, the player’s network owner is the client so whether you do it from server or client the result WILL NOT differ in any capacity. In my experience, it’s also best to do hit detection on client, and to follow the ‘shooter is always right’ idea that most games follow. Doing this on something like the server cause situations like people with guns shooting someone on their screen and it not hitting, and basically the same thing in your situation but with katanas!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.