Hey! I’ve always found myself stuck when it comes to how I want to create ViewModels in my projects. I have successfully made them more than once, but traditionally, it has been easier to just have a bunch of different ViewModels, cache them at the start of the game, and then switch them out whenever I need to. For example, if I press the “One” key, it may pull out the “KnifeVM”, but if I press the “Two” key, it unparents the KnifeVM and parents the “GunVM” to the camera.
I’ve never exactly understood how making one global ViewModel works, and how I should approach attaching different weapons to it at a different times. This also leads to my other main point of confusion: Animation. When using one VM, what exactly is the workflow of animation…? I feel like it’d be difficult to constantly attach weapons to a ViewModel to animate them. With the multiple VM approach, it seems easier just to be able to pull out the “GunVM”, animate as I need, then put it back and we’re good to go.
Is the single ViewModel approach both viable, and easy to setup? I just need a bit of help understanding that here, or if that’s even the best practice. Thanks in advance for any advice!