How to fix player bouncing multiple times

I have a bounce pad in my game and it bounces the player. it’s in a OnCollisonEnter2D function and it looks like this (this is a part of the script)

     if (transform.tag == "Bouncer")
    {
        Rigidbody2D rb = collision.transform.GetComponent<Rigidbody2D>();

        if (rb != null)
        {
            rb.AddRelativeForce(new Vector2(0f, BounceForce), ForceMode2D.Impulse);
        }
    }

I also have a slowing down time feature in my game that slows down time when the player presses Q. But if I do this while going onto the bounce pad, It bounces the player multiple times instead of once. Please help.

Sort of figured it out, the OnCollisionEnter is getting called twice for some reason but i still don’t know how to fix the problem.

Alright, figured it out. I used DateTime to ignore the second bounce, here’s how i did it but it may vary from games because this is for a slow motion game like karlson or superhot. Timebounce is my DateTime variable. Make sure to set yours to DateTime.Now when you create the variable

if (TimeBounce.AddSeconds(.2 / Time.timeScale) <= DateTime.Now)
                {
                    if (rb != null)
                    {
                        Debug.Log("Bounce");
                        rb.AddRelativeForce(new Vector2(0f, BounceForce), ForceMode2D.Impulse);
                        TimeBounce = DateTime.Now;

                    }
                }

Alright, figured it out. I used DateTime to ignore the second bounce, here’s how i did it but it may vary from games because this is for a slow motion game like karlson or superhot. Timebounce is my DateTime variable. Make sure to set yours to DateTime.Now when you create the variable

if (TimeBounce.AddSeconds(.2 / Time.timeScale) <= DateTime.Now)
                {
                    if (rb != null)
                    {
                        Debug.Log("Bounce");
                        rb.AddRelativeForce(new Vector2(0f, BounceForce), ForceMode2D.Impulse);
                        TimeBounce = DateTime.Now;

                    }
                }