Recently, I made a (sort of) viewmodel for a project. Everything went smoothly, until I decided to make an Idle animation for the hands.
This is how it should look like:
and this is how it looks in-game:
(yes, the hands look reversed, like they are facing the character instead of in-front of it.
Problem is, I want it to look just like in the first pic (hands pointed where the player looks) and to not show the bottom of the hands
(In first pic animation, the hands are moved back to not show the bottom and to get them closer to the camera.
Any Help? Current Code:
local RunService = game:GetService("RunService")
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local handsRS = game.ReplicatedStorage:WaitForChild("HandsModel")
local cam = workspace.CurrentCamera
local equipped = nil
local handsModel = handsRS:Clone()
handsModel.Parent = cam
local hands = handsModel:WaitForChild("HandsRig")
hands.Parent = cam.HandsModel
local Animator = handsModel.AnimationController:WaitForChild("Animator")
if equipped == nil then
local Anim = Instance.new("Animation", hands)
Anim.AnimationId = "rbxassetid://10001717888"
local LoadAnim = Animator:LoadAnimation(Anim)
LoadAnim:Play()
end
RunService.RenderStepped:Connect(function()
hands.CFrame = cam.CFrame + (cam.CFrame.LookVector * Vector3.new(2, 2, 2))
if (cam.CFrame.p - cam.Focus.p).Magnitude < 0.6 then
hands.Transparency = 0
else
hands.Transparency = 1
end
end)
Also, to mention, the hands are replicated from ReplStorage and cloned as the camera’s child