I’ve looked through tons of DevForum posts, and have found nothing… This is my first time using raycast, am I blind and missing something, or is this a bug??
Script:
base = workspace.TestVectorBase
clone = workspace.TestVectorClone
local Laser = base.Position
local LaserDetector = clone.Position
local raycastParameters = RaycastParams.new()
raycastParameters.FilterDescendantsInstances = {game.Workspace.NodeBoundaries:GetChildren()}
raycastParameters.FilterType = Enum.RaycastFilterType.Include
raycastParameters.IgnoreWater = true
local ray = game.Workspace:Raycast(Laser, LaserDetector, raycastParameters)
if ray then
if ray.Instance.Name == "NodeBoundary" then
print("Hit a boundary", ray.Instance.Name)
local part = Instance.new("Part")
part.Parent = game.Workspace
part.Anchored = true
part.Position = ray.Position
elseif ray.Instance.Name == "Node" then
print("Hit a node", ray.Instance.Name)
else
print("Instance:", ray.Instance.Name)
end
else
print("This node can be used!")
end
Result 1:
Ray detects no NodeBoundary, even though 2 are in the way…
Result 2:
Ray detects NodeBoundary, even though theres none in the way…
The white surface on TestVectorBase & TestVectorClone, are surface guis that show the front face
Edit:
The selected 2 are the NodeBoundary’s in both images above