I'm a rookie with scripting, so not that well-versed.
It only works with global directions opposite of the +/- sign, offsets to the left just fine.
However, if I face the same direction as the +/- sign, it just offsets the ray to the RIGHT.
My goal is to offset the ray's origin (not direction) from the HRP at most 2 studs to the left of my player, and have that offset be reliant on the player's orientation to itself, and not on the global XYZ coordinates.
TL;DR - I just want to change the ray's origin to always be on my left, even in shiftlock.
Sorry if I explained it poorly, I'll give you more information if you need it.
local MixedOriginZ1 = Vector3.new(origin.X origin.Y,origin.Z+1.6)
local MixedOriginZ2 = Vector3.new(origin.X, origin.Y,origin.Z+0.5)
local MixedOriginZ3 =Vector3.new(origin.X, origin.Y,origin.Z-0.5)
--local origin2 = c['Right Arm'].Position
--local direction2 = c['Right Arm'].CFrame.lookVector*3.5
--local origin3 = (origin+origin2)/2
local R = Ray.new(MixedOriginZ2, direction)
local R2 = Ray.new(MixedOriginZ2,direction2)
local R3 = Ray.new(MixedOriginZ2,direction3)
The relevant snippet of a much larger script.

3 comments
Not a math solution, but you could just have an invisible part welded to the HRP on the left side of the player where you want the ray to start.
True, that does solve the problem, I would give you points if no one comes up with a math solution.
UPDATE: Someone solved this problem with this line of code: local RayOrigin = (HRP.CFrame * CFrame.new(-2,0,0)).p