This is more of a general design based question.
I am working on a 2D fighting game and was looking for some advice on hit boxes. Since I will have an online multiplayer component, I was curious which design practice sounds the best for networking code:
-
For each character, have all their hit-boxes attached with the character prefab and simply activate them. So all the hit boxes are in the scene, placed in relation to the character and they only activate when the correct attack is called.
-
Instantiate each individual hitbox in relation to the character and delete the hit box after use.
I think the first choice might help the net code since I won’t be making so many instantiation calls at once. The second option might be a bit more complicated to deal with and lead to some complication issues and a lot of true-false validation for the moves.
Thank you for any advice!