I have a feature in my game where a laser is firing at the player. I want the player to also be able to collect objects that would increase the players health. Here is the code that I used to try to increase the health:
I am happy to report back that I got it to work. I realized that the tag code was slightly different so I just modified the code above replacing name with tag and it worked.
If you’re using name make sure the name is the same as the name of the gameobject with the collier on it, it won’t detect a parent or child object’s name