Trying to make an object appear in a position, but only if that position isn't occupied.
My question is a bit of a multi-part deal.
I'm trying to make it so that a button from scene1
is able to spawn an object in scene2
in a designated position, we'll call it slot 1. I've set up a bool variable to track if it is occupied ( slot1Occupied
).
if (slot1Occupied != true) { // spawn object at that slot }
The first problem is that the button to spawn the object is in scene1
while the script tracking slot 1 is in scene2
. How would I go about reading that bool in another scene.
The next question is, once it is determined that slot1 is not occupied, how will I be able to press a button in scene1
to create an object in scene2
?
Thanks for the help in advance!
Your answer
Follow this Question
Related Questions
TMP Dropdown resets its value 0 Answers
I want Script To Move a object from a different object (In four Different directions,Randomly) . 0 Answers
Keep the distance of one object relative to another while changing its size 0 Answers
AddListener fuction throwing a NullReferenceException error 1 Answer