You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Aligned sights, upperarm moves with the cursor(in first person) Hoping to either get info on better ways to do this or something like that -
What is the issue? Include screenshots / videos if possible!
only aligns in center, rotates wierd looking down and either up or down isnt aligned.
2023-12-06 00-17-21|video -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Everything. i tried IK and moving the gun to head nd offset, looked over every aim topic i could find.
The lowerarm and hand are animated if that makes a difference im semi new to this i just been using animations till now
runservice.Stepped:Connect(function()
local hit = Mouse.Hit
-- Calculate the direction vector from the arm to the mouse hit
local direction = (hit.Position - RightUpperArm.Position).unit
-- get the rotation offset (so the arm points correctly depending on your rotation)
local rootCFrame = HumanoidRootPart.CFrame
local rotationOffset = (rootCFrame - rootCFrame.Position):inverse()
-- Calculate the new arm CFrame
local newArmCFrame = rotationOffset * CFrame.new(Vector3.new(0,0,0), direction)
RightShoulder.Transform = newArmCFrame * CFrame.Angles(math.rad(110.237), 0, math.rad(-28.877))