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.