local CheckRay = Ray.new(Ball.Position, Vector3.new(0,Ball.Size.Y / 2 + .05,0 ))
local WhiteList = {workspace.Terrain, workspace.Water:GetChildren()}
local Hit = workspace:FindPartOnRayWithWhitelist(CheckRay,WhiteList,true )
while wait(0.1) do
print(Hit)
end
This will return a data structure that looks like this:
{workspace.Terrain, { ... the children of workspace.Water ... }}
Note the nested table, it’s not a flat table of just objects, it has an inner table. You get the error because that inner table is not an object.
You can create the whitelist like this instead:
local WhiteList = workspace.Water:GetChildren()
table.insert(WhiteList, workspace.Terrain)
This way, it stays a flat table without inner tables, since you are just adding a value to the end of the table (workspace.Terrain, in this case).
Note also that your while-loop is pointless, it will print the same value every 0.1 seconds. If you meant to keep doing raycasts, then move the raycast call into the while-loop instead.
local CheckRay = Ray.new(Ball.Position, Vector3.new(0,Ball.Size.Y / 2 + .05,0 ))
This means your ray starts at the Ball.Position, and the direction is the second value. That would be a positive number since size.Y is always positive. So you are casting upwards.