I’m currently having issues with my Raycast getting the full size of a part? When trying to note if a Player is under a block, there seems to be an overlap where although the Player is under said part, the code recognises it as not being under it.
Is there a work around to this as it’s causing some issues.
RunService.RenderStepped:Connect(function()
for _,GetParts in pairs (workspace:GetDescendants()) do
if GetParts.Name == "CameraRay" then
table.insert(whiteListTb, GetParts)
local ray = Ray.new(Character:WaitForChild("HumanoidRootPart").CFrame.p, Character:WaitForChild("HumanoidRootPart").CFrame.p + Vector3.new(0, 50, 0))
local RayHit, NA = workspace:FindPartOnRayWithWhitelist(ray, whiteListTb)
if RayHit then
Camera.CFrame = CFrame.new(RayHit.Parent["CameraOrigin"].CFrame.p, RayHit.Parent["CameraDirection"].CFrame.p)
else end
else end
end
end)