Trigger Problem (242948)

I have a 2D Object with a 2D box collider set to Trigger. It is the Time upgrade. The circle is the player.
This is what happens:
173685-giphy-1.gif
The script is made to slow down time when the player triggers the collider.
The player is not in contact with the collider but the time still slows down.
There is no collider anywhere else which will slow down time.
Please Help me

Can you show a video of this happening in scene view with the player and Time upgrade selected? I suspect that the cone attached to the top of the player is triggering the Time upgrade, since colliders can fall through to their child sprites.

–

1 Answer

1

so; i’m guessing your you slow the time using something like this:

void slowTime()
{
    //do something to slow time
}

private void OnTriggerEnter2D(Collider2D collision)
{
    if (collision.CompareTag("x"))
    {
        slowTime();
    }
}

if so try using making a script called timeNormal() or something and put it in the ontriggerexit funcrion:

void timeNormal() {
//something
}

private void OnTriggerExit2D(Collider2D other)
{
    if (other.CompareTag("x"))
    {
        timeNormal();
    }
}

if that doesn’t help please send your script and i’ll see what i can do goodluck in your game