#Raycast Not Excluding ignorelist?

2 messages · Page 1 of 1 (latest)

marble moon
#

You're supposed to move forward to lunge for an attack, this functions normally in a regular R6 character, but looking at the image you can tell this is a scenario with a new StarterCharacter.
The script only SOMETIMES moves the character the desired distance, I assume this is because the raycast gets caught on the player model, please help fix this issue.
(Btw script is supposed to move you about 10 studs to lunge, but usually only nudges you around 2)

heres the part of the script thats supposed to move the character

                for _, part in ipairs(char:GetChildren()) do
                    if part:IsA("Accessory") then
                        table.insert(ignorelist, part.Handle)
                    else
                        table.insert(ignorelist, part)
                    end
                    print(ignorelist)
                end
                
                local RayParams = RaycastParams.new()
                RayParams.FilterType = Enum.RaycastFilterType.Exclude
                RayParams.FilterDescendantsInstances = ignorelist
                local Raycast = workspace:Raycast(HumanoidRootPart.Position, HumanoidRootPart.CFrame.LookVector * Module.MU_Distance)
                if Raycast then
                    AlignPosition.Position = Raycast.Position
                else
                    AlignPosition.Position = HumanoidRootPart.Position + HumanoidRootPart.CFrame.LookVector * Module.MU_Distance
                end
#

nevermind im stupid i forgot to include it when casting the ray