Need help connecting LookVector to other Vector operations (raycasting)

I am trying to get a raycast to cast in a certain direction. I know there are many other forum posts like this one, but the issue is that i need the raycast to both update the origin and
to be tilted by a certain amount. here is a picture i drew of what i mean:

when the part moves, i want the raycast to move with it.

here is the script i have so far (only the important parts):

local torso = script.Parent:WaitForChild("Torso")

direction = Vector3.new(torso.CFrame.LookVector * 99)

local raycastResult_B = workspace:Raycast(torso.Position, direction)

you mean like, the ray direction is always going up-left from the part? or you mean the raycast changes directions mid-raycast?

the former. I want the raycast to always tilt left relative to it’s parent part

from the picture, you are going up-left relative the the part.

local direction = (CFrame.UpVector-CFrame.RightVector).Magnitude * 99

wait i forgot that raycasts work in 3D, i shouldve mentioned that was a top down view, my bad.

EDIT: trying the same thing as what you said but with lookvector instead of upvector (hoping it works out)

update: did not need raycasts for my purposes to begin with