Greetings,
I am in a bit of trouble with the following script:
function raycast()
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {NPCsFolder, Character}
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
raycastParams.IgnoreWater = true
local raycastResult = workspace:Raycast(Character.HumanoidRootPart.Position, NPC.Head.Position, raycastParams);
if raycastResult then
workspace.Baseplate.Color = Color3.new(0,1,0); --green
else
workspace.Baseplate.Color = Color3.new(1,0,0); --red
end
end
Now, the issue is as follows:
Proper hit
Improper hit
Now, as you can see, the raycast does not detect the part when the player is standing on right side of it. Does anyone know why this is the case?