Combat System | Need some hints of best way to do this

Hello! I’m currently working on a combat system and I’m wondering what the best way is to handle hitboxes without causing lag. I was considering creating hitboxes locally and detecting hits on the client, then letting the server validate things like distance, but I’m not sure if that’s actually a good approach.

Also, is it better to implement the combat system using an OOP method, or is it fine to just use basic scripts inside the tool?

You are better off using already made, public resource, like:

  • EZ Hitbox if you want quite extensively featured hitbox detection, or
  • Barbs Hitbox which is quite new, but has easy to use methods/functions and you can get started quite fast with it.

These are only few public resources, and based on documentation and other peoples feedback, these seem to be best and currently maintained. I don’t see any reason to reinvent the wheel all over again, only if public modules don’t do what you exactly need.

Maybe you’re right, but I want to create my own combat system entirely, where all the systems are made by me. I don’t want to copy other people’s scripts - I want to learn how to make hitboxes myself

in that case, i believe it just depends on what kind of hitboxes you want

if you want raycast hitboxes, they are a bit demanding so i would run it on client and validate distance and what not on the server

however if you want a boundinpart kind of hitbox, you could easily run it on server, but the hitbox will probably look delayed if ran on the server, you could get the client’s location to combat this but i would recommend ensuring their distance is too far from how the server sees where they are

1 Like