local function snapRotation(target, snappedZRad)
if target and target.Name ~= "ATTACHMENT" then return end
if not target then return end
local primaryPart = target.Parent.PrimaryPart
if not primaryPart then return end
local cframe = primaryPart.CFrame
local rY = math.rad(char.Head.Orientation.Y)
target.Parent:SetPrimaryPartCFrame(CFrame.new(cframe.Position) * CFrame.Angles(0, rY -math.rad(90), snappedZRad))
end
so, the issue is rY is behaving odd once the player turns to a certain angle, for example; if the player is within that certain angle and stops holding the item they are carrying, and picks it up again the item will be in a new orientation.
my goal was to have the item match the character’s rotation but it’s obviously not working and i’m stuck on how to fix this.