I have one script that instantiates coins and another one for the coin itself. So once the coin itself is collected by the player, it should disappear and tell the first script to instantiate another. I tried many times to access booleans across separate scripts like so...
//script 1
public script2name scriptVar;
void start()
{
scriptVar.GetComponent<script2name>();
}
void func()
{
if (scriptVar.boole1 == true)
{ //create another coin
}
}
//script 2 (script2name)
public bool Boole1 = false;
void func()
{
// picks up coin
Boole1 = true;
}
I tried this however there was no response in the system, I never got another coin, it simply does not work.