Hello,
I'm trying to display a level of a game by enabling the mesh renderer for all the objects in the level once the player reaches a certain checkpoint and collides with it, but I can't seem to make the code work:
if (collision.collider.name == "checkpoint1")
{
GameObject.FindGameObjectsWithTag("level2").renderer.enabled = true;
}
The problem is .renderer property cannot be used with the GameObjects finder. Does anybody know a way to solve this or an alternative?
Thanks.
↧