I am a total noob so perhaps someone can let me know if there is a major downside to this.
I don’t like the idea of having to ignore warnings if there is an easy way to get rid of them. The warnings that Rick ignores in this video are warnings that visual studio sends because there are items in the code that don’t have a value in the code before it runs, but we assign through the inspector.
To fix this I just initialize serialized items as null and then I no longer get these errors and as soon as you run the game the values are updated by the inspector as usual so I think this is a clean solution.
For example in the current Weapon script at the top we have:
[SerializeField] ParticleSystem muzzleFlash;
[SerializeField] GameObject hitExplosion;
[SerializeField] AudioClip fireSound;
[SerializeField] Camera fPCamera;
instead I list them like this:
[SerializeField] ParticleSystem muzzleFlash = null;
[SerializeField] GameObject hitExplosion = null;
[SerializeField] AudioClip fireSound = null;
[SerializeField] Camera fPCamera = null;
This way they are initialized and will no longer give warnings and as far as I can tell there are no problems so far since everything runs great.