I am trying to recreate the system when a player grabs a tool and without the need to recreate an anniamtion, I also want to make the arm always stay at 90 degrees in the crfame. To do this, I have come up with the idea that the arm will always point to a part that will be in front of him and even if the character is turned the arm will always point 90 degrees globally.
The problem comes when I can not get the arm to point to a part and that while an animation is playing.
I have tried to use the LookAt.CFrame and Motor6D.Transform variables but it still doesn’t work.
No, I fixed. I realized that it was much easier and I didn’t need to create another part. This is the script I made. thankss
local PlayersService = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = PlayersService.LocalPlayer
RunService.Stepped:connect(function()
local character = LocalPlayer.Character
if character then
local torso = character:FindFirstChild("Torso")
if torso then
local rightShoulder = torso:FindFirstChild("Right Shoulder")
if rightShoulder then
rightShoulder.Transform = CFrame.Angles(0, 0, math.rad(90 - character:FindFirstChild("Torso").Orientation.X))
end
end
end
end)