I
I
igorloadgame2021-03-18 16:06:59
C++ / C#
igorloadgame, 2021-03-18 16:06:59

Is it possible to make the actions in OnTriggerEnter happen every frame?

if (other.tag == "Defolt(Blue)")
        {
            defoltCar.SetActive(false);
            defoltCarBlue.SetActive(true);
            Taxi.SetActive(false);
            Police.SetActive(false);
            Sport.SetActive(false);
            if (EorShopSCene.defoltbluecar == true) 
            {
                Buytxt.text = "Select";
            } else if(EorShopSCene.defoltbluecar == false)
            {
                Buytxt.text = "Buy: 15";
            }
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pashara, 2021-03-18
@igorloadgame

You can get by with OnTriggerStay, or by setting a flag in OnTriggerEnter/Exit, and update the data according to your logic and your update.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question