Hi everybody !
I pretty nex to Unity and c# and I’m making a 3D platform game in which I would implement the same mechanic than in HeatMan stage from MegaMan 2. Make platforms disappear as the next appear.
I tried to make my plateforms appear while every other disappear, but it doesn’t work correctly.
Here’s what I’ve tried so far :
void Update ()
{
StartCoroutine(MegaManTrap());
}
IEnumerator MegaManTrap()
{
for (int i = 0 ; i < pf.Length ; i++)
{
if (pf*.activeInHierarchy == false)*
{
pf*.SetActive(true);*
}
yield return new WaitForSeconds(Pop);
for (int v = 0 ; v < pf.Length ; v++)
{
if (v != i)
{
if (pf*.activeInHierarchy == true)*
{
pf*.SetActive(false);*
}
}
}
yield return new WaitForSeconds(Depop);
}
}
I don’t find the right way to do this, is it possible to have some help plz =) ?