I made a viewmodel and am trying to play animations i’ve made for it. The model is rigged correctly and has all the needed components but it won’t play at all.
local hum = script.Parent:FindFirstChild("Humanoid")
local humanim = hum:LoadAnimation(script.ReceiverGrab)
wait(3)
humanim:Play()```
I’m not using viewports I’m just cframing it with the camera, and I’m just trying to get the animation to play on the model separate just in the workspace for now
Maybe try this:
Parent the model to a local script in StarterPlayerScripts, and then make the local script reparent the model to the camera, and then set its position every frame.
local RunService = game:GetService("RunService")
local ViewModel = script:WaitForChild("ViewModel")
local ViewModelAnimator = ViewModel:WaitForChild("Humanoid"):WaitForChild("Animator")
local GrabAnim = ViewModelAnimator:LoadAnimation(script:WaitForChild("ReceiverGrab")
local Camera = workspace.CurrentCamera
ViewModel.Parent = Camera
-- When you want the animation to play
GrabAnim:Play()
RunService.RenderStepped:Connect(function(dt)
ViewModel.PrimaryPart.CFrame = Camera.CFrame
end
Ive done this system on a few of my games and it seems to work completely fine.