ClientCast - A Client-based, Idiosyncratic Hitbox System!

Alr thanks for the quick response.
If I only use 1 for some reason the first hit hits multiple times
Im sure it’s probably because of the debounce Im using but this only happens when I use a single caster for all the weapon attacks for some reason

Hey I am having troubles with using the ClientCast Module and I run into a problem of :SetOwner() and the 3rd parameter for player. I tried my best to look through the replies but can’t find my solution. My problem is that the hitbox does not work intended whenever I have the 3rd parameter for .new() when the player to set as the Owner but whenever I leave it for the server to decide, it works just fine. Even though leaving it blank and using :SetOwner() didn’t fix the solution. I wanted the hitbox set owner to the user, and not to the server. I checked errors and no errors seem to be found.

Here is the code:

local newhitbox = hitbox.new(HandleHere, raycastParams, plr)
local connection_ = newhitbox.HumanoidCollided:Connect(function(RaycastResult, HitHumanoid)
	print(RaycastResult, HitHumanoid)
end)

newhitbox:Start()

task.delay(Duration, function()
	newhitbox:Stop()
	connection_:Disconnect()
end)

and then this is what i see in-game:

1 Like

Hey, could you call :StartDebug() on the caster and see if it’s being raycast on the client? Additionally, could you make sure you’re using the latest version in case of any bugs? Thanks!

When I do :StartDebug() it does not show any debug lines and errors. I also made sure I did install the one from Oct 30, 2022 v1.14.0 on github.

Could you try isolating as much of the code as possible, and send a .rbxl of the code which reproduces the issue in as little code as possible? Thanks!

I think I am doing something wrong it works fine actually but I look into it

Oh my gosh, I realized that the ClientHandler AttachmentName is not the same as the Module. My bad.

1 Like

Whats the difference between this and RaycastHitboxV4

This module aims to provide easy client-server communication, unlike other modules which only handle hitboxes.

Sorry, If these already got answered above but

  1. What does it mean when you say client-server communication when it runs on the server?
  2. Does it only work on moving parts?

The client calculates the hitbox, and sends the result to the server. The server handles the actual hitbox logic, but behind the scenes its all calculated on the client (though you can set it to be server-only).

Correct. It raycasts from the previous to the current position, so if ||p1 - p0|| = 0, the raycast distance will also be 0.

1 Like

How safe is it to calculate everything on the client?
also fi the player ping is high, should I cast on the server?

Hello Just want to notify you there is a new update for raycast.
Will you update your module or no ?

No, because shapecasts are more expensive and dont solve the issue of raycasting between gaps like so:
image
Since raycasts are lines, they can perfectly raycast from the start to the end, with fidelity and precision being configurable with the amount of damage points you set.

1 Like

I’m getting a strange bug where object is not being replicated - i tracked it to here. Can you check it?



I can’t do much with this info, I need a place file which reproduces the issue in as few lines as possible. Are you sure you’re passing an Instance to the first argument of ClientCast.new though?

exampleOfProblem.rbxl (58.4 KB)
I don’t think the problem is me because in your code it prints the object

1 Like

It seems like the issue is related to Roblox replication - the local client’s own character seems to not have replicated in time to the client, so when the server sends a remote with the character as the owner, the client doesn’t recognize the object as it doesnt yet exist on its side.
I’ve been able to fix it by adding task.wait(2) before creating the caster, but in general you should try creating the caster on-demand, and only re-use the caster after it was created the first time.

1 Like

is there anyway I can visualize the rays on a single client?

Hello, I am currently using this module to detect collision. However, I added a section in my script to check the distance between the target and the caster. In my case it’s 14 Studs. I added this checker to account for the delay between server and client and exploiters.

The issue is that when an enemy is large and is further away from the caster, it won’t deal damage. Does anyone have any solution to this problem?

This is a video I made earlier when I thought the issue was from client cast not detecting other parts from a character