how teleport the player

hi,i’m a beginner who try to create a first simple 2d game, i have my player that when i press a button(W for example) he is teleported forward, i’ve made everything(animation,script) and it works but the only problem during the teleport he can collide with another object,but i want that when i press the button it can cross another object but when it finish to teleport it turn back to collide like it usually do.Can you help me please?
ps: sorry for my very bad english haahahah

While teleporting, you can try turning on isKinematic.

Then when your player is done teleporting, turn it back off.

Something like this:

if(Input.GetKey(KeyCode.W))
{
rigidbody2D.isKinematic = true;
} else {
rigidbody2D.isKinematic = false;
}