How would i load an animation onto a viewmodel?

I have a tool that when its equipped, it will attach a viewmodel to the camera. But I am not able to wrap my head around how to load an animation onto it.

I can’t load the animation until its parented to the camera.
If i load the animations after its equipped, i would have to load it every other time because i cant access the variables in other places within the script.

this is probably a stupid question that i just dont understand, but how do i do this?

i will put my script if anybody needs it