Similarly to how you would play an animation outside of the viewport (on Workspace), you can play an animation inside the viewport. Locate where the humanoid is located within the viewport and load the animation into the character. Then play the animation as you would always do.
I’m pretty sure it’s the same way regardless if it’s a ViewModel or in Workspace in terms of playing the animation. Try playing the animation inside Workspace to see if the animation is configured correctly. Once that is done, you can use the same method, but instead of Workspace, it would be inside ViewModel. Make sure to change the pathing of whatever animation you’re trying to play it on.
this is a script inside starter character scripts and the veiwmodel is cloned from workspace also i tried doing script.parent.AnimationController it doesnt work
Im Using a local script inside of startercharacterscripts to animate a clone of the veiwmodel, sorry i should have clarified that and the viewmodel is also only cloned on the client so i server script wouldnt work