Movement in game affecting hit detection

Hello, I have found an issue with my movement i have in my game and can’t seem to fix it. The movement scripts basically make my head look where im looking and move my arms where im looking if im holding a tool. Here is the issue:

This is the client.
client

This is the server
server

They are both the same, I didn’t move. The issue isn’t with the movement script as it works, its with the hitbox I have which is: RaycastHitbox

Since the movement of the arms and head only changes in other clients via another remote event, in the server my character is still in default orientations.

When the orientation is different, on client it could like it hit but on the server because of the orientation difference it could be too short to hit etc.

This results of these is: https://gyazo.com/96e98a99a91520c323ad2d7c29988a50

As you can see, it just passes through the dummy and doesn’t detect any hit.

I do require the module on client, work with it in client and I think it runs on the client but still, this is the only reason I could think of as the reason of hitbox not detecting it.

And of course replicating the players movement on the server would be really laggy and since there would be at least 0.5 delay(what I prefer for the best performance) it still would do that.

I’m not sure if it is what I have explained causing this, but please help me out on this.

Since you don’t want to replicate the players’ movement you can try to replicate just the facing direction to the server when the player attacks for the hit detection process, updating the direction a few times could be good for acurracy.

You can also try to raycast within a given area and range increassing the range as the attack duration rans out and aiming towords the player look direction.

The best option for player responsiviness would be using the RaycastHitbox on the client side and checking on the server side if the hit is valid (is the target near enough? Has the attack ran out?), of course that brings some exploiting possibilitys but having real time audio/visual feedback can be a nice touch on how the gameplay feels.

The thing is I already use the RaycastHitbox in a client, only use server to replicate sounds,damage etc.
Maybe RaycastHitbox somehow uses the server sides orientations?

Well I fixed it. I made the arms replicate once when the swing happens and now it works. I also had this idea but didn’t think that was the issue since the module is required on the client. Thank you.

1 Like

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