Using players arms to make a viewmodel

trying to be lazy and instead of making a viewmodel trying to do what the title said. I know it may be harder, but hey it may work.

let me show you what I have so far.

code:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")

local Character = script.Parent
local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
local Camera = workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local Events = ReplicatedStorage.Events

local mouse = Player:GetMouse()


local UpperTorso = Character:FindFirstChild("UpperTorso")
local RightShoulder = Character:FindFirstChild("UpperTorso").RightShoulder


RunService.RenderStepped:Connect(function()
	if RightShoulder:IsA("Motor6D") then
		RightShoulder.C0 = CFrame.new((Camera.CFrame.Position - UpperTorso.RightShoulderRigAttachment.WorldPosition))
	end
	for i, part in pairs(Character:GetChildren())do
		if string.match(part.Name, "Arm")or string.match(part.Name, "Hand") then
			part.LocalTransparencyModifier = 0
		end
	end
end)

all it does though is make the arms fly every where tho :frowning:

Firstly, wouldn’t the arms quite literally be hidden when you’re in first person?

Next, you shouldn’t be trying to reposition the right shoulder (nor the left) anyways. What you should be doing is rotating them so that they face the same angle as the camera.

here is the code turning them visible.

btw What I’ve been doing is just messing with values

Oh wait missed that

Still, you shouldn’t be changing the position of the CFrame. Doing so would just attempt to rip the arms off of the torso. What you should be doing is changing its orientation so that it matches that of the camera when relative to the body.

Its a first person game. Idc if the arms are of the torso I just want them at the sides of the camera.

sorry if this came off agressive

I know, but I don’t think Motor6Ds likes their c0 and c1 disconnected

well then how will I do this then? I just don’t want to make 2 animations for different models.

Try changing the rotation (and only the rotation) part of the CFrame to the rotation part of the CFrame of the camera

could you elaborate (I’m stupid)

also, wouldn’t that just move the whole character?

(hopefully that works)

ok well actually that talks about rotation the camera

just do like

RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(Camera.CFrame.Rotation)

image

Oh wait im stupid

RightShoulder.C0 = RightShoulder.C0 * Camera.CFrame.Rotation

forgot that thats already a CFrame angle

image
I don’t think that will move it to the camera.

also, when I go into first person it just spins.

See if this forum can help.

ok wait lemme see rq
aaaaaaaaaaaaa

oh yeah uh

RightShoulder.C0 = RightShoulder.C0.Position + CFrame.Angles(Camera.CFrame.Rotation)

argument 3 missing or nil has happened

I don’t want to clone the arms, I want to use the arms.

yea no i made the mistake again, remove the “CFrame.Angles”