So i want to make a viewmodel for my game. but in console it says Transform is not a valid member of Attachment “Workspace.comradeshvab.UpperTorso.LeftShoulderRigAttachment”
is there any way to fix that???
local LocalPlayer = game:GetService("Players").LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local RenderStepped = game:GetService("RunService").RenderStepped
local ViewModel = game:GetService("ReplicatedStorage").ViewModel:Clone()
local ViewModelRoot = ViewModel.PrimaryPart
ViewModel.Parent = workspace
RenderStepped:Connect(function ()
ViewModelRoot.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0, -1.5, 0)
-- Hardcoded logic test
ViewModel.UpperTorso.LeftShoulderRigAttachment.Transform = Character.UpperTorso.LeftShoulderRigAttachment.Transform
ViewModel.UpperTorso.RightShoulderRigAttachment.Transform = Character.UpperTorso.RightShoulderRigAttachment.Transform
end)