Hi experts, I’m giving my first steps with Unity and doing my first tutorial, Roll a Ball tutorial.
After doing it completely I was trying to add something, I want to set to active every object that I deactivated by picking up the collectables when the ball hits the walls
I added this code to the ball (player) Script trying to do so but does not work:
private GameObject[] pickups = new GameObject[12];
void OnCollisionEnter(Collision col){
if (col.gameObject.CompareTag ("Wall")) {
pickups = GameObject.FindGameObjectsWithTag("Pick Up");
foreach(GameObject go in pickups){
go.SetActive(true);
}
}
Hope that someone can help me with this,
Best
Jose