For some reason, even if I specify that I don’t want the player model or the effects to be counted in the raycast, it still manages to hit the player. I’ve been debuging this for a bit and I can’t figure it out.
This script is located in game.StarterPlayer.StarterCharacterScripts
local HumanoidRootPart = script.Parent:WaitForChild("HumanoidRootPart")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()
local Torso = script.Parent:WaitForChild("Torso")
local parentBlackList = {Character, game.ReplicatedStorage.Resources}
local Blacklist = {}
for i=1, 2, 1 do
for _, items in pairs(parentBlackList[i]:GetDescendants()) do
table.insert(Blacklist, items)
print("Blacklisted: "..tostring(items.Name))
end
end
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
raycastParams.FilterDescendantsInstances = Blacklist
while wait(0.1) do
local result = workspace:Raycast(HumanoidRootPart.Position, (HumanoidRootPart.CFrame.LookVector) * 5)
if result then
HumanoidRootPart.Velocity = (HumanoidRootPart.CFrame.LookVector + Vector3.new(0,-3,0)) * -25
print(result)
end
end