I have this cSharp code which runs fine, but I want to add a boolean run_once control to my code as it is part of a class that scans input and is called by Update
HI, can’t really see what’s the problem with only that little part of your code but “conflicts with a declaration in a child block” means you have another declaration of “playerMissile001” in another block when you should have only one. Use CTRL+F to find where you’re declaring the objects and remove those not needed.
For what it’s worth, those objects you are declaring inside the if { } are going to vanish immediately after you exit the code block. I have a feeling you mean to do this:
With static variables I don’t need to create an instance of InitializeModels.
Because of this I removed this line of code that instantiated InitializeModels :
InitializeModels initializeModels = new InitializeModels();
I added the word static after public or private to all the variables inside the class InitializeModels()