Blocking object from going through colliders (no rigidbody) [2D]

I’m making a 2D game, where players fight with tanks and need to block them from going through walls.
I tried adding RigidBody2D, but it has other effects on the tank movement that i do not want.
Is it possible to use a RigidBody2D only for blocking move through colliders or to use something else to solve this?

What effects of the rigidbody do you not want?

You can change many settings on the rigidbody, such as ‘is Kinematic’, ‘freeze position’ and ‘use gravity’.
If none of those work you can try removing the rigidbody and just using a box collider instead. Make sure that ‘is trigger’ is NOT checked on the collider, otherwise it wont collide.

Hope this answers your question