Raycast not hitting the ground but removing the params makes it work

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Have the raycast hit the ground from the character

  2. What is the issue? Include screenshots / videos if possible!
    The raycast is not hitting the ground

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Yes, but removing the raycast params makes it work but i need the params to exclude the character body parts

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

The raycast is casted from the characters body downwards however it dosen’t work but removing the raycast params makes it work but i need the raycast params obviously to make it not hit body parts

This is a startercharactersscripts script

local char = script.Parent

local humanoidrootpart = char.PrimaryPart
local torso = char:WaitForChild("UpperTorso")

local rparams = RaycastParams.new()
rparams.FilterType = Enum.RaycastFilterType.Exclude
rparams.FilterDescendantsInstances = {char}

while task.wait(0.5) do
local rayresult = workspace:Raycast(humanoidrootpart.Position, Vector3.new(-90, 0, 0), rparams)
if rayresult then
print("hit")
end
end
1 Like

sir downward is - y not -x . it should be Vector3.new(0,-idk,0)

1 Like

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