Public Variables Behave as Static
I currently have multiple objects with the same script attached to it, but each of the scripts has a different value for one of the public variables. However, when I run the program all the scripts end up with the same value. I even tried creating a test public int, and I changed half of the objects int value to 1 and the other half to 0, yet they all ended up having the value of 0.
Answer by UnitedFailures · Jul 12, 2017 at 08:51 AM
For clarification, right now I currently cycle through a public array of GameObject prefabs that each have a script attached to it, and I run a method on each of them.
Your answer
Follow this Question
Related Questions
unity camera problem 0 Answers
How do iOS devices handle unsupported texture compression algorithms? 0 Answers
Baked lightmap in unity 5.2 not affect on android device 2 Answers
Map creator inside my game 0 Answers
Help with Pause Menu 1 Answer