Set false a non-trigger object when colliding with a trigger object
Let's take the tutorial program for Roll-A-Ball. The Player(Sphere) is surrounded by four Walls(Cubes). The Player is a trigger. The Walls are not. This allows the player to bounce off the walls when they come in contact. I want the wall to despawn when the player collects 12 objects and touches the wall.
void OnTriggerEnter(Collider other)
{
if (count >=12 && other.gameObject.CompareTag ("Despawn Wall")) {
other.gameObject.SetActive (false);
}
}
This code only works when the object with that tag is a Trigger. But then that object is no longer a wall. Are both possible together?
Comment
Your answer

Follow this Question
Related Questions
Trigger Sets GameObject 0 Answers
KeyCode not detected when OnTriggerStay = true 1 Answer
NullReferenceException when using gameObject.SetActive(false); 0 Answers
SetActive is just working if i press twice in the first time 2 Answers
I need my script to continue after i have set the first, help 1 Answer