I’m trying to make a raycast face down but it needs to take into account the parts rotation. This is the script im using:
local rayOrigin = script.Parent.Position + Vector3.new(3,0,0)
local rayDirection = Vector3.new(0,-1,0)
local rayLength = 50
local raycastParams = RaycastParams.new()
local hitPart, hitPosition = workspace:FindPartOnRayWithIgnoreList(Ray.new(rayOrigin, rayDirection * rayLength), {}, false, true)
The ‘ray direction’ is causing the problem. I’ve tried using FromEulerAngles but that doesn’t work and causes an error. Does anyone know how to achieve this?