So, I have been making an FPS game following a tutorial from 2020, in the tutorial there is a view model, there is also a weapon that is put inside the view model with a moduleScript called “settings”, when you equip the weapon it ungroups it and puts it inside the viewmodel so the settings module is then inside the viewmodel, the settings module contains variables for all the animations that the viewmodel needs to, well, animate.
The settings module looks like this:
When I tried to load it via a module script it gave me this error:
(the only thing that matters here is the modules.FPS.99 (line 99)
Here is the FPS module script where I load it in:
self.viewmodel.settings is the settings module.
What I have tried so far is:
- checking if settings is equal to nil in the script (it isn’t)
- checking if settings is equal to nil in the script (it isn’t)
- checking if settings.animations is equal to nil (it isn’t)
- checking if settings.animations.viewmodel is equal to nil (it isn’t)
- checking if settings.animations.viewmodel.idle is equal to nil (it isn’t)
- removing self.loadedAnimations.idle:Play(0) and putting it on the end of the loadAnimation line. (This played the animation but still causes problems in the script elsewhere, since the script needs the self.loadedAnimations.idle variable)
Its weird because the idle animation variable in the settings module isnt equal to nil when I run the game, but the module script says that its equal to nil when it tries to load it.
I have been using these tutorials to make the fps game: