How to make raycast less direct?

I know this sounds odd but I think raycast detection is too direct. I have a raycast from the entire character (it’s a hitbox welded to the character) and the raycast works and all but I have to be facing the object DIRECTLY. This means if I am facing the part but shift lock and slightly tilt myself, the detection goes off. Is there a way to make raycast go outward and make it more reliable on including tilt? Here’s the raycast code in local script.

	local raycastParams =
			raycastParams.FilterType = Enum.RaycastFilterType.Whitelist

			raycastParams.FilterDescendantsInstances = {workspace.SoccerBall}

			local raycastResult = workspace:Raycast(char.HitBox.Position, char.HitBox.CFrame.LookVector*5, raycastParams)

			if raycastResult  then

				local currentPart = raycastResult.Instance

1 Like

There’s already a similar thread here: Increasing Ray Thickness & Making Ray Hit Multiple Targets
You can either make multiple raycasts and launch them in different directions, or just create a part and use it in combination with GetTouchingParts()

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