Home > Mobile >  Call GameOverScreen GameOverScreen.Setup();
Call GameOverScreen GameOverScreen.Setup();

Time:04-09

I am having trouble activating the Game over screen and I was just curois if there was a way to check A tag Like this GameOverScreen.Setup(Check Object hit and if tag is Obstacle);

here is my script and also I did not work with Void OnTriggerEnter()

public GameOverScreen GameOverScreen;

public void GameOver(){

        GameOverScreen.Setup();
    }
   

CodePudding user response:

The easiest way of checking what object hit another is with OnTriggerEnter or OnCollisionEnter, then you can use CompareTag to check what tag the object you hit has then call GameOver from there.

  • Related