HitboxClass | v1.1B | A Powerful OOP-based Hitbox Module

Creating the hitbox on the client and handling networking manually would have its benefits if the game’s architecture intends to handle everything about the combat in the client and simply handle sanity checks and damage on the server since there’d be no lag in creating the hitboxes when needed, which is normally made because the server needs to ping to the client to start the hitbox.

For the second question, I’ve had no issues with it so far, but I imagine if the combat is abnormally fast, handling the hitboxes solely on the client, along with likely the rest of the combat, would be ideal in that case.

Sorry for the late response!

You’re probably using a client-sided hitbox which yields the code till it gets a response from the client. If you’re not, then that’s an issue not related to the module.

Is the red box where the character is on the server and other clients? If so then you should probably either keep the hitbox the same or predict the character’s position too and not just the hitbox.

The idea is to improve responsiveness for the person the hitbox is for by having it line up better with what they see on their screen. It uses the velocity the server sees in order to predict the character’s position on that player’s client.

What game genre is this useful for? I’m making an FPS game and unfortunately I don’t have a use for it because it would just cause a mess.

RPGs and Fighting Games are what come to mind, where areas of space would likely be used in an attack (like a fireball or a punch), you could use this for your melee attacks. For an FPS game, I’d recommend FastCast for your guns.

I’ve been having problems with this lately, where the hitboxes start to stack if nothing was hit, is there a way to fix this?

Sounds like a logic issue? How are you calling :Stop()?

I call :Stop() after the swing animation reaches the “SwingEnd” animation marker. Another example of this happening is when the taunt animation reaches the “Spit” animation marker, turning on debug shows the hitbox disappearing, but then walking in front of a player causes the healing effect to activate, even after the hitbox dissapears

(taunt)

Are these client-sided or server-sided hitboxes? I’m gonna try and see if I can replicate the issue.

They are server-sided. keystrokes keystrokes

hi i was wondering if you forgot to update the HitboxClass.rbxm file in the github for v1.1B, it still shows me the 1.1A inside the script and the object touched still doesnt seem to work with it

1 Like

I have a very big problem making a combat game
I used Client-Mode in hitbox settings (is in server script so that might be the problem)
and One player can only Damage?

How do I stop the memory leaks from this module?

They have been plaguing my Roblox game for a while now, whenever a script that makes a hitbox gets destroyed within the lifetime of a hitbox (The debris thing) the hitbox’s part and array that holds it’s elements never get deleted ever, like at all. If you could provide a solution that would be very awesome!

2 Likes

Why is the hitbox ahead of my rock object when it launches in the air and drops down. The hitbox makes it get destroyed before it hits the ground

Do you have VelocityPrediction enabled?

Will this get Wally support?

Would be extremely useful to be able to easily keep up to date with any updates.

It’s the correct version, I just forgot to change the version number.

Like @WonderWorksXD said, sounds it’s VelocityPrediction is enabled. Turn it off.

If you’d like, dm me some example code of how you’re deleting things. I’m deleting a script spawning the hitbox and the hitbox still destroys itself just fine. Might be a memory management issue on my end or I can see if I can help you figure out what’s up.