with this framework, i want to both copy the arm’s movement and attach it to the camera, but im not sure how. maybe by attaching the arms to the camera with cframes and then updating them with respect to humanoid root part? idk
localplayer.CharacterAdded:Connect(function(character)
while not character:FindFirstChild("HumanoidRootPart") do
wait()
end
local viewmodel = Instance.new("Model")
local humanoid = Instance.new("Humanoid", viewmodel)
viewmodel.Parent = workspace.Camera
viewmodel.PrimaryPart = viewmodel:FindFirstChild("HumanoidRootPart")
local characterParts = {}
local viewmodelParts = {}
for _, part in pairs(character:GetChildren()) do
if part:IsA("BasePart") then
if part.Name == "HumanoidRootPart" or part.Name == "Left Arm" or part.Name == "Right Arm" then
characterParts[part.Name] = part
local clone = part:Clone()
clone.Parent = viewmodel
viewmodelParts[part.Name] = clone
for _, child in pairs(clone:GetChildren()) do
child:Destroy()
end
end
end
end
runservice.RenderStepped:Connect(function()
for partName, characterPart in pairs(characterParts) do
viewmodelParts[partName].CFrame = characterPart.CFrame
end
end)