I have 2 flags, when the player touches them they should be SetActive(false);
For some reason, this isn’t happening, but the scoring system of it is working.
They both are prefabs have a network identity and a network transform and they are registered in the manager. Any help would be amazing ![]()
void OnCollisionEnter(Collision col)
{
if (col.gameObject.tag == "RedFlag")
{
if (TeamPick.bluePick == true)
{
RedFlagPickedUp = true;
redFlag.SetActive(false);
Debug.Log("Flag Triggered");
}
if (BlueFlagPickedUp == true)
{
StartCoroutine("BlueFlagRespawn");
Points._points += 1;
BlueFlagPickedUp = false;
}
}
if (col.gameObject.tag == "BlueFlag")
{
if (TeamPick.redPick == true)
{
BlueFlagPickedUp = true;
blueFlag.SetActive(false);
Debug.Log("Flag Triggered");
}
if (RedFlagPickedUp == true)
{
StartCoroutine("RedFlagRespawn");
Points._points += 1;
RedFlagPickedUp = false;
}
}
}