Hello! I am encountering some problem where my raycasting script is not working. I have a collision group called “Hitbox” in which all of my custom player hitboxes are set to. (CollisionGroupId = 2)
When the raycast is fired it filters out the players own hitbox but leaves the rest. Yet when the raycast is fired at a hitbox it prints nil!
Here is the code:
local serverParam = RaycastParams.new()
serverParam.FilterDescendantsInstances = {workspace.Hitboxes:FindFirstChild(game.Players.LocalPlayer.Name)}
serverParam.FilterType = Enum.RaycastFilterType.Blacklist
serverParam.CollisionGroup = "Hitbox"
local serverCastResult = workspace:Raycast(origin, direction * self.settings.firing.distance, serverParam)
print(serverCastResult)