hello everyone in my game i have a 3 keys in a level; when all 3 keys are collected i want to set active a gameobject (like winning object) i created a code in that code if the keys are 0 the game object is set active false but when the keys are 3 game object is still false i will attach my script to you
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BlueWining : MonoBehaviour {
public GameObject continued;
// public int KeysToUnlock;
private int keys;
// Use this for initialization
void Start()
{
keys = BlueKeyText.KeyAmount;
}
// Update is called once per frame
void Update()
{
if (keys == KeysToUnlock)
{
continued.SetActive(true);
}
else
{
continued.SetActive(false);
}
}
}