Ugalde
Ugalde
CC#
Created by Ugalde on 10/30/2023 in #help
❔ How to make it so a panel can't appear when another one is active
This is the script for the finish line:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class FinishLine : MonoBehaviour
{
public GameObject winPanel;
public GameObject losePanel;


private void OnTriggerEnter(Collider Col)
{
if (Col.gameObject.tag == "RealPlayer")
{
winPanel.SetActive(true);

}

if (Col.gameObject.tag == "Player")
{
losePanel.SetActive(true);

}
}

// Update is called once per frame
void Update()
{

}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class FinishLine : MonoBehaviour
{
public GameObject winPanel;
public GameObject losePanel;


private void OnTriggerEnter(Collider Col)
{
if (Col.gameObject.tag == "RealPlayer")
{
winPanel.SetActive(true);

}

if (Col.gameObject.tag == "Player")
{
losePanel.SetActive(true);

}
}

// Update is called once per frame
void Update()
{

}
}
5 replies