Is it possible to have a joint without it's locked on an axis

I want that my object will interact with other objects but they won’t affect it’s position, like it’s connected to something too strong to change that way.
But from what I’m seeing, every joint does the job well except for one very important thing, I can’t move the object in every direction I desire. I want it to be able to be affected in the x and y axis, is that possible?
Thanks in advance.

I found the problem. It was the configurable joint I thought didn’t work but it was my mistake which has nothing to do with the configurable joint…
Use configurable joint…
Sorry for the silly post.