How to share a personalized variable between parent and child objects

Hello.

I’d like to know how to share a variable that acts as a “private” in the context that it is specific to the object it is attached to, instead of globally referencing every instance of that variable, but I need this variable to communicate with another object.

Consider an enemy object prefab with a healthbar child. This enemy needs to keep its own health amount but the healthbar also needs to know how much health it has. How could I share a variable like that? Thank you for reading.

I found that there was no problem at all. You can use a public variable on a prefab and have every instance of that variable personalized to that prefab.