replacing tags with GetComponent
Avoid magic-string tags by querying components directly with TryGetComponent to identify entities and invoke public methods.
- Unity tags act as magic strings that are prone to bugs and best avoided when identifying game objects
- Calling a method on a retrieved script requires storing the component reference from GetComponent rather than calling the method on the GameObject
- TryGetComponent replaces tag comparisons by checking for the target script and assigning an out variable in a single step
- Methods called from external scripts must be marked public to be accessible across components


