Why is the right arm of my viewmodel bound to the left arm?

Hey there! I’m making a parkour game, and I am trying to add guns. Everything works fine, until I try to set the CFrame of the viewmodel arms to the CFrame of the player’s arms.

Problem:
https://streamable.com/837z0w

Part of the script that sets the CFrame:

viewmodel["Right Arm"].CFrame = character["Right Arm"].CFrame
viewmodel["Left Arm"].CFrame = character["Left Arm"].CFrame
if idleAnim.IsPlaying then
	idleAnim:Stop()
end

That piece of script is inside a RenderStepped loop.

I’ll gadly provide more information if you need it. Any help is appreciated!

Is there a motor6d or any weld of that matter directly connecting one arm to another ?

No, there are not. The arms are both connected to a torso using a Motor6D. The torso is then connected to a RootPart. The torso’s CFrame is not being changed at all, and no animations are being played.

1 Like

The script example you showed wasn’t very helpful, although can you check and debug to see what the character looks like, since you are moving both the left and right CFrame of the viewmodel onto the character, can you check to see if the character’s animation or pose is causing it?

As shown here:
https://streamable.com/ggn4m3

The character is not what is causing this. Here is some more code that might be helpful:

runService.RenderStepped:Connect(function(deltaTime)
	currentDeltaTime = deltaTime

	if canAttach and not isLedgeGrab.Value and not isWallrunning.Value then
		if not idleAnim.IsPlaying then
			idleAnim:Play()
		end
		if humanoid.MoveDirection.Magnitude > 0 then
			local a = .05
			local b = .1

			local t = tick()
			local dt = 1/10

			local X = b * math.sin(t*9)
			local Y = a * math.cos(t*18)
			local Z = 0

			CF = CF:Lerp(CFrame.new(X, Y, Z),  1-.01^deltaTime)
			walkCFrame = walkCFrame:Lerp(CFrame.new(0,0,.2), 1-.01^deltaTime)

			t += dt
		else
			CF = CF:Lerp(CFrame.new(0,0,0),  1-.01^deltaTime)
			walkCFrame = walkCFrame:Lerp(CFrame.new(0,0,0), 1-.01^deltaTime)
		end

		local velocity = humanoid.RootPart.Velocity

		local finalOffset = CFrame.new(0,-1.5,-.5) * walkCFrame * CF

		local speed = 1

		local modifier = 0.05

		local mouseDelta = game:GetService("UserInputService"):GetMouseDelta()
		swaySpring:shove(Vector3.new(mouseDelta.x / 2000,mouseDelta.y / 2000))

		local swayCFrame = swaySpring:update(deltaTime)
		local walkCycle = movementSpring:update(deltaTime)

		viewmodel.PrimaryPart.CFrame = cam.CFrame:ToWorldSpace(finalOffset)

		viewmodel.PrimaryPart.CFrame = viewmodel.PrimaryPart.CFrame * CFrame.Angles(0,-swayCFrame.x,swayCFrame.y)

		cam.CFrame = cam.CFrame
	elseif canAttach and isLedgeGrab.Value then
		viewmodel["Right Arm"].CFrame = character["Right Arm"].CFrame
		viewmodel["Left Arm"].CFrame = character["Left Arm"].CFrame
		if idleAnim.IsPlaying then
			idleAnim:Stop()
		end
	elseif canAttach and isWallrunning.Value then
		viewmodel["Right Arm"].CFrame = character["Right Arm"].CFrame
		viewmodel["Left Arm"].CFrame = character["Left Arm"].CFrame
		if idleAnim.IsPlaying then
			idleAnim:Stop()
		end
	end
end)

Both of the .Value’s are correct.

Edit:
The directory if that is helpful whatsoever:
image

Is both of the shoulder m6d’s part 0 set to the torso?

Yes, they are both set to the torso.

1 Like

Then I need to see more of the code, also can you verify that the torso isn’t moving at all?

The code I sent above is all of the code that is actually changing the viewmodel, this is also the only script that accesses it.

1 Like

Can you just clarify that the torso isn’t moving at all (just select it while you are in the turned view)

Ah, I see what you mean. Now that I looked at it, the torso is moving

do you need the welds on the viewmodel? i feel like there messing it up

Yes, I need the Motor6Ds, otherwise the animations won’t be able to play. There are currently no actual welds on the viewmodel

1 Like

how about you try disabling the motor6d’s only during/when you are changing the physical cframes of those arms?

1 Like

Didn’t really think of that, but it seems to have worked! Thanks!

1 Like

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