Hello, I’m still trying to get a rig right for some pistons that are off - center of any axis.
So far I have 2 bones placed at outer / inner part of piston. They both have a track to constraint. Now I would like to limit the sliding of lower bone to blue line in image.
You can create a custom orientation from your selection (be it an object, a bone, a mesh face…) from the 3DView header : click the + icon in the transform orientations popover (the one showing global, local, etc). Then you can transform using these new axes.
If you’re asking how to rig the piston so that it moves on this axis during animation, it’s different. Depends how you rigged it in the first place… I assume you used constraints? most of them allow picking local space in their properties, using that would “just work”.