im trying to point my arms towards the mouse, it works perfectly for the look vector but as soon as i turn my character to the left or right or behind, it prevents my rotation from acting normally.
im also not sure about where the x,. y, z axises of the motor6d faces in general.
i have no idea what is going on so if someone knows i would really appreciate it! ![]()
local torso = c:WaitForChild("Torso")
local rightArm = c:WaitForChild("Right Arm")
local rightShoulder:Motor6D = torso:FindFirstChild("Right Shoulder")
local originalC0 = rightShoulder.C0
local originalC1 = rightShoulder.C1
gun.Equipped:Connect(function()
connection = runService.Stepped:Connect(function()
local playerMouse = p:GetMouse()
local mouse = uis:GetMouseLocation()
local unitRay = camera:ScreenPointToRay(mouse.X, mouse.Y)
local direction = (playerMouse.Origin.Position - playerMouse.Hit.Position).Unit
local params = RaycastParams.new()
params.FilterDescendantsInstances = {c}
params.FilterType = Enum.RaycastFilterType.Exclude
rightShoulder.C0 = rightShoulder.C0:Lerp(originalC0 * CFrame.Angles(0, math.asin(direction.X), -math.asin(direction.Y)) , 0.4)
local x,y,z = rightShoulder.C0:ToOrientation()
--print(playerMouse.Hit.Position)
--print("X:"..math.deg(x), "Y:"..math.deg(y), "Z:"..math.deg(z))
--print(c.PrimaryPart.CFrame.LookVector)
end)
end)
the problem starts at 0:12
(i really hate motor6d’s with a passion, they’re so hard to understand lol.)