Need help with transform and collision

I use transforms to move the player around. When I hold the w key and ram the player against a wall, the player’s collider goes somewhat into the wall’s collider. When I release the w key the wall shoves the player back out. Is there any way to prevent the player from phasing into the wall?

You’ll have to use a Rigidbody/Rigidbody2D component to move the object when using colliders in order to obey physics collisions.

See: