You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? A functional viewmodel on R15 characters
-
What is the issue? The shoulders are not “animating”
Here is what it would look like when not attached to the character
The code is quite simple
local OFFSET = 2
local runService = game:GetService("RunService")
local character = script.Parent
local VM = game.ReplicatedStorage.VM:Clone()
VM.Parent = workspace.CurrentCamera
local leftShoulder = character.LeftUpperArm["LeftShoulder"]
local rightShoulder = character.RightUpperArm["RightShoulder"]
runService.RenderStepped:Connect(function()
character:FindFirstChild("RightUpperArm").LocalTransparencyModifier = 0
character:FindFirstChild("RightLowerArm").LocalTransparencyModifier = 0
character:FindFirstChild("RightHand").LocalTransparencyModifier = 0
character:FindFirstChild("LeftUpperArm").LocalTransparencyModifier = 0
character:FindFirstChild("LeftLowerArm").LocalTransparencyModifier = 0
character:FindFirstChild("LeftHand").LocalTransparencyModifier = 0
VM:SetPrimaryPartCFrame(workspace.CurrentCamera.CFrame + workspace.CurrentCamera.CFrame.LookVector * OFFSET)
local dist = (workspace.CurrentCamera.CFrame.Position - character.Head.Position).Magnitude
if dist < 2 then
rightShoulder.Part0 = VM.Torso
leftShoulder.Part0 = VM.Torso
else
rightShoulder.Part0 = character.UpperTorso
leftShoulder.Part0 = character.UpperTorso
end
end)