Hello!
I am currently working on creating some system that finds where two parts intersect. The problem is that when casting from a CFrame’s LookVector, it always returns nil and I am not sure why.
To help visualize:
Script:
local p = Instance.new('Part') -- create pink part
p.Parent = workspace
p.CFrame = workspace.Part1.CFrame * CFrame.new(-4, 0, 0)
local i = workspace.IntersectPart -- part intersecting with green part
local newCFrame = i.CFrame * CFrame.Angles(0, math.rad(90), 0) -- create new CFrame, CFrame of the green part
local ray = workspace:Raycast(newCFrame.Position, newCFrame.LookVector)
print(ray) -- nil