How to make my player dash through hazards.

So I have my Player character in my unity project, added a dash effect. I dont know how to make the player dash through the hazards without disabling his boxcollider2D, which makes it fall through the floor. Then make the player take damage when it isn’t dashing.
Any Solutions?

Well, if you are using rigidbody then set it to kinematic first, turn off collider, move to new dash location (either over time, or instantly), then turn collider back on, and rigidbody back to not kinematic. Thats how I would do it based on your post.