Raycasts are inaccurate - intersecting objects they should be unable to

My game raycasts on the client and sends the information to the server when it hits something, and I have noticed that my hitboxes have been hitting impossible places. Example:


image
The red sphere is the visualized hit position. The lines (ignore the white spheres & long straight lines, those are for other purposes) are the visualized raycasts. I raycast on every Heartbeat, raycasting from an attachment’s position during the previous frame to its current position.

Reproduction file: https://devforum.roblox.com/t/repro-file/1461697

As the animation is made by our group, you can’t use it in studio due to lack of permissions. Please see this reply on how to go about it:
https://devforum.roblox.com/t/repro-file/1461697/4

Reproduction steps:

  1. Open reproduction file, press Play (client)
  2. Wait to spawn in
  3. Look down on the hotbar at the bottom, and equip Steel Rapier (either through clicking the number it is on or by clicking on the item slot)
  4. Left click and observe - you may need to do so several times.

Expected behavior: The rays should not falsely intersect the dummy.

Additional information:

  1. The raycasting code can be found on line 240 of the ClientHandler LocalScript.
  2. Disabling the beta features does not address the issue.
  3. I have removed everything unrelated to the weapon code and only kept one primitive in the workspace so that you do not fall upon spawning.
4 Likes

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

1 Like