Essentially, there are three races in a tier in our game. The car should only upgrade if a button is clicked in the first two of those races. That’s the purpose of checking the scene, since the races are individual scenes. I can’t keep track of that myself. Will the script at the root solve this?
As far as I can tell, you are not loading any scenes and the UI is cloned in multiple scenes (it’s not the way I would do it for maintenance reasons but that’s a separate issue).
You can solve this a few ways:
Add a boolean attribute to whatever script is managing the UI that controls the enabling or disabling of the upgrade button. That way you can disable the upgrade button on a per scene basis
Add a script that when initialize is called, adds a scene id/name to a global list and removes it on destroy. This allows you to query the list when you need to check what scenes have been loaded
When you do write a race scene load, keep track (in a global variable or something) of what race scene was selected by the player