I made this script thats supposed to find a target, but it just aims down and I dont know why
function checkSight(target)
local ray = Ray.new(myHead.Position,(target.Position - myHead.Position).Unit * 75)
local hit,position = workspace:FindPartOnRayWithIgnoreList(ray,{script.Parent})
if hit then
print(hit)
if hit:IsDescendantOf(target.Parent) then
return true
end
end
return false
end
Yes, it prints what it has hit, it only hits baseplate.
And I’m making a turret type of thing, the script is inside the model and the head is inside them ode laswell.