Shade Cloak in Unity

Hello, I’m making a 2D platformer game and I want the dash ability to work pretty much like Hollow Knight’s Shade Cloak ability. However, I’m relatively new to Unity and am not sure how to tackle passing through an enemy only when the player is dashing and was wondering if someone here could help me get on the right track please? I appreciate any help and thank you.

Try using Physics2D.IgnoreLayerCollision. As soon as you start dashing, disable collision between the enemy layer and the player layer. When you are finished dashing, reenable it.