I am trying to make this ray aim down so i can find the part that's under you but it keeps only going in the direction of the lookVector.
This is what i have so far related to the Ray.
local torso = player.Character.HumanoidRootPart local ray = Ray.new(torso.CFrame.p, (torso.CFrame.lookVector + CFrame.fromEulerAnglesXYZ(0,math.rad(90),0 ).p)*100) local part, position = game.Workspace:FindPartOnRay(ray) print(part.Name)
I played around with it and tried different CFrame combos but it seems to not work and only go in the direction you're looking. I'm trying to angle it down at the ground.
Try Changing The Angle From 90 To 270 This May Just Work By Flipping The Angles! (Be Sure To Upvote If this helped! :D) So The Code Will Look Like This:
local torso = player.Character.HumanoidRootPart local ray = Ray.new(torso.CFrame.p, (torso.CFrame.lookVector + CFrame.fromEulerAnglesXYZ(0,math.rad(270),0 ).p)*100) local part, position = game.Workspace:FindPartOnRay(ray) print(part.Name)