So, on this project I have a script (JS):
#pragma strict
function Start () {
Destroy(GameObject.Find(“cell1door”)) || Destroy(GameObject.Find(“cell2door”));
}
Now, I get an error with the the || part.
Is there any way of fixing this where both have a 50% chance of being destroyed.
You can’t use this syntax.
You have to do something like this:
function Start () {
if(Random.value >0.5)
Destroy(GameObject.Find("cell1door"));
else
Destroy(GameObject.Find("cell2door"));
}