Beginner Scripting: Scope and Access Modifiers


 

In this weeks Coding Task it was looking at the hierarchy in changing variables in script and with Unity. Something I took away from it was that inspector trumps public but start void trumps inspector when it comes to giving variables and changing them. So making sure the Start void variable is the correct one seems to be the way to use Unity. Im sure there is other rules that link with this one that go against what I understood but for now I will use this logic and see how it works when I am coding. Another interesting tip from this week was that if you want to link two different scripts together that the code must be Public and not Private. This will ensure access to the other scripts. 

Comments

Popular Posts