Get position at same y level given 2 unit vectors

I was able to get it working with some help from a guy from the Roblox OSS Community discord server. He gave me this function and it works perfectly!

function getPlaneIntersection(
	origin: Point,
	normal: Normal,
	planeOrigin: Point,
	planeAxis: Axis
): (Point, number)
	local rpoint: Point = origin - planeOrigin
	local dot: number = -math.abs(normal:Dot(planeAxis))

	if dot == 0 then
		return origin, 0
	end

	local dist: number = rpoint:Dot(planeAxis) / dot
	return origin + dist * normal, dist
end

Thank you guys for trying to help anyways! I really appreciate it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.