So, i tried making a viewmodel script from the code snippets and the repro file that colbert2677 gave and made my own modifications to it, but it doesn’t work correctly, and the topic has no further information on the script after Hexcede’s conclusion on the viewmodel problem.
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
local ViewModelTorso = ViewModel.Torso
ViewModel.Parent = workspace
RenderStepped:Connect(function ()
ViewModelRoot.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0, -1.5, 0)
-- Hardcoded logic test
ViewModelTorso["Left Shoulder"].Transform = Character.Torso["Left Shoulder"].Transform
ViewModelTorso["Right Shoulder"].Transform = Character.Torso["Right Shoulder"].Transform
ViewModelRoot["RootJoint"].Transform = Character.HumanoidRootPart["RootJoint"].Transform
if Character:FindFirstChildOfClass("Tool")~= nil then
Character.Torso.ToolGrip.Part1 = nil
ViewModelTorso.ToolGrip.Part1 = Character:FindFirstChildOfClass("Tool").BodyAttach
ViewModelTorso.ToolGrip.C0 = ViewModelTorso.ToolGrip.C0 * CFrame.new(0,0,0)
end
end)
my viewmodel also uses HumanoidRootPart instead of Torso, as the animations i use contain torso rotations.
the collision i’m having in the video is actually the tool itself rather than the viewmodel.
I’m having difficulties changing the motor6D’s to the viewmodel, but you could show me your version, too, if that’s okay.
Alright, I know I’m very late. BUT. I found a resource that uses the real arms like viewmodels. Just putting this out here so that other people don’t have to go thru this pain.