3D Rope swing on one axis no matter what

Hello everyone!
i’m a total noob and probably it’s a silly question:
i’m creating a rope using hinge jointS on a rigged mesh in 3D and everything works super fine in terms of simulation .
I need that this rope does not move anytime on the z axes,basically simulating a 2D rope .
I know that hinge joint can fix the LOCAL rotation on one axes, but i need that this rope wont be able to rotate on the other axes in world space.i can tell you that also fixing the z position/rotation of the rigidbodies of the rope from the inspector does not work. If the rope gets hit on the z axes it moves anyway, or gets crazy: i need it to stay still.
How do i do that?Thanks to everyone for the help!

If you are trying to simulate a 2D rope, why would you not allow rotation on the z-axis? Do you mean the y-axis?