Why are arms not moving in sync with the torso?

How would I make the arms move in sync with the torso? There is an animation playing so i’m not sure if it’s interfering. Also it might be interfering with the head movement since it looks to the side instead of facing the mouse when aiming the bow. Thanks!

The code I used (credits to CleverSource , Need help with torso and head following mouse)

local RunService = game:GetService("RunService")

local Player = game.Players.LocalPlayer
local PlayerMouse = Player:GetMouse()

local Camera = workspace.CurrentCamera

local Character = Player.Character or Player.CharacterAdded:Wait()
local Head = Character:WaitForChild("Head")
local Neck = Head:WaitForChild("Neck")

local Torso = Character:WaitForChild("UpperTorso")
local Waist = Torso:WaitForChild("Waist")

local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")

local NeckOriginC0 = Neck.C0
local WaistOriginC0 = Waist.C0

Neck.MaxVelocity = 1/3

local UIS = game:GetService("UserInputService")

RunService.RenderStepped:Connect(function() 
	if not UIS:IsKeyDown(Enum.KeyCode.Q) then return end
	
	local CameraCFrame = Camera.CoordinateFrame

	if Character:FindFirstChild("UpperTorso") and Character:FindFirstChild("Head") then
		local TorsoLookVector = Torso.CFrame.lookVector
		local HeadPosition = Head.CFrame.p

		if Neck and Waist then
			if Camera.CameraSubject:IsDescendantOf(Character) or Camera.CameraSubject:IsDescendantOf(Player) then
				local Point = PlayerMouse.Hit.p

				local Distance = (Head.CFrame.p - Point).magnitude
				local Difference = Head.CFrame.Y - Point.Y

				Neck.C0 = Neck.C0:lerp(NeckOriginC0 * CFrame.Angles(-(math.atan(Difference / Distance) * 0.5), (((HeadPosition - Point).Unit):Cross(TorsoLookVector)).Y * 1, 0), 0.5 / 2)
				Waist.C0 = Waist.C0:lerp(WaistOriginC0 * CFrame.Angles(-(math.atan(Difference / Distance) * 0.5), (((HeadPosition - Point).Unit):Cross(TorsoLookVector)).Y * 0.5, 0), 0.5 / 2)
			end
		end
	end	
end)

1 Like

dude thats just where your mouse was positioned there is nothing wrong with the script

? The torso hardly moves and when I point up, the character doesn’t aim up. Unlike when I’m not using the bow everything works accordingly.

oh thats because of the animation , animating the hands also controls the torso

Its probably because the Retargeting property in Workspace is enabled. It solves for the best orientation that matches with the one described in the current animation playing.

2 Likes

Thank you so much, I probably would’ve never considered that :sob:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.