I have player prefabs for a project I’m working on, and it occurs to me I don’t know how to link a new prefab to the UI automatically. Basically when a new prefab is loaded, say after a character death, all the UI references are cleared and the health bar, image toggles and all that no longer work because all the references to them in the inspector are empty.
This is my first game project which incorporates a complex UI and this is a dumb issue that, although isn’t a problem right now, will be a problem once I start work on the multiplayer aspect of the game that requires respawing and the like. So how do I have an asset automatically link all the UI image and slider references from the UI?
The player health is linked to the UI so right now the ships explode upon loading as they aren’t linked to the health bar so the script assumes health is zero. This is funny but not desirable.