Greetings!
An AI Created part of my script that I really needed help with for YEARS at this point, and I am wondering how I can make an ignore list with WorldRoot:Raycast()
Here’s what I have:
local module = {}
function module.new(startPosition, startDirection)
local maxDistance = startDirection.magnitude
local direction = startDirection.unit
local lastPosition = startPosition
local distance = 0
local result
repeat
local ray = Ray.new(lastPosition, direction * (maxDistance - distance))
result = game.Workspace:Raycast(ray.Origin, ray.Direction --[[maxDistance - distance]])
if result then
if not result.Instance.CanCollide then
break
-- No equivalent to ignore list in Raycast, so you will have to find a different way to handle this
end
end
distance = (startPosition - result.Position).magnitude
lastPosition = result.Position
until distance >= maxDistance - 0.1 or (result and result.Instance.CanCollide)
return result.Instance, result.Position, result.Normal
end
return module
I specifically need help where it says No equivikent to ignore list in Raycast, so you will have to find a different way to handle this.
Thanks in advance!