- Home /
Question by
KloverGames · Aug 28, 2018 at 05:33 AM ·
scenessetactivegame objectreferences
How to reference game objects across scenes?
How would I set active a game object from another scene? If I'm in scene 2 and I press a button, I want that button to set a game object active in scene 1. I'm working on a game and the shop is in a different scene than the actual game, I need to know how to reference game objects across scenes or else I'll have to start the entire project over and do it single scene. Thanks.
Comment
This can be achieved by making a non-destroyable object.
Save the shop number clicked by the player in the non-destroyable script in the first scene.
Use the saved variable value in the second scene to open the particular shop.