Hey
var number : int;
function Start() {
number = Random.Range(1,1);
}
function OnTriggerEnter( other : Collider ) {
Debug.Log("Function is working well!");
if (other.tag == "Tree") {
Debug.Log("Tag tree founded! ");
if (number == 1){
Debug.Log("Work fine!");
}
}
}
This is my script that I made.
When I turn my game on and I go to Collider I get log Debug.Log(“Function is working well!”);
But
Debug.Log("Tag tree founded! ");
if (number == 1){
Debug.Log("Work fine!");
}
Doesn’t show.
I made new tag and I attach it.
What is the problem in this script ?