I have a sphere, all i want to to do is hide object until the variable kill is equals to 8.
The variable kill is from another script.
Thanks for any help.
I have a sphere, all i want to to do is hide object until the variable kill is equals to 8.
The variable kill is from another script.
Thanks for any help.
It's comething like this:
function Update(){
counter=GameObject.Find("NameOfTheObjectContaingTheScript").GetComponent(NameOfTheScriptContainingKill).kill;
if (counter>=8)
renderer.enabled=true;
}
counter is declared taking the value of kill from another script (attached to an other object, not to your sphere). "renderer.enabled=true" allows the sphere to be visible. Remember to set renderer=false at the beginning, to let it invisible.
This is what my code is looking like now after changes ive made and get an error message:
BCE0044: expecting ‘*’, found ‘’.
renderer.enabled=false;
function Update(){
counter=GameObject.Find(“kill”).GetComponent(Score).Sphere;
if (counter>=8)
renderer.enabled=true;
}