First Person ViewModel Problems

Hello, guys.

I have tried making hands visible in first person through ViewModel.

This is the model:
https://gyazo.com/b7caf5fad3ff7a0cad55f30e28a037cd

I want to achieve that these Fake Hands will replicate the movement of the actual player’s hands.
Why? So I can just animate hands animations, and it will replicate.
This is the script:

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.LeftUpperArm["LeftShoulder"].Transform = Character.LeftUpperArm["LeftShoulder"].Transform
	ViewModel.RightUpperArm["RightShoulder"].Transform = Character.RightUpperArm["RightShoulder"].Transform
end)

Problems are:
It doesn’t show the hands, and the hands are pushing the player forward.
Thanks for response.

1 Like

Parent the viewmodel to the camera(This keeps the local workspace clean) and CFrame the viewmodel’s main root part on the right position of the camera within the renderstepped. Regarding the fix of the hands pushing the user, turn CanCollide off of all the parts within the viewmodel.

This should fix all of it hopefully.

Ok, I’ll do that in a bit.
Thanks for response.

VoidedBlade helped me a lot, and now the arms are there.

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.CurrentCamera

RenderStepped:Connect(function ()
	ViewModelRoot.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0, -1.5, 0)
	-- Hardcoded logic test
	ViewModel.LeftUpperArm.CFrame = Character.LeftUpperArm.CFrame
	ViewModel.RightUpperArm.CFrame = Character.RightUpperArm.CFrame
end)

The problem is that while rotating it is a bit laggy.

https://gyazo.com/78aa48d89b7286b5ec220a450bff94be