I’m new to unity and I’m working on a very basic game until I learn Unity however, I don’t know how I should logically restructure my scripts or how to Google this issue.
I have a shop that spawns an instance of a gun prefab; this works fine except when I shoot/reload/anything on the players gun it mirrors it to the gun in the shop. How should I go about fixing it? I just need the logic behind my mistakes and how an ideal basic setup would work.
Hard to tell exactly what your problem is without seeing the scripts. Generally you want all functions (like shooting/reloading/anything) to be private to that object, so that you’re not accidentally triggering things across multiple objects. Look up global variables and why you should use them sparingly. Good luck
Are u using any scriptable objects which could trigger the following error…
Maybe u might have ur weapons on the walls actively checking for inputs…
Remember to disable your weapons script for all except for players…
Just disable the gun script on them and enable when it equipe and again disable when equiped…