Blender Piston Rig - Jumping Axis - Animation

Hi guys,
acutally I have a big problem with my animations exported from Blender. I am not an Animator and or Rigger, so I already thought this could be a potential problem for my current project, but I hoped the best. Well, now I imported everything and I have some problems.

I rigged some pistons for my mechanical arm. In Blender it works just fine, but after importing the skeletal mesh and playing the animation in the engine, the pistons flips around.

How my rig works:

The tip of the constrained bone stretches to the tip of the main rotation bone. The two small bones on top are parented to the stretched bone. These are linked to the piston mesh and it works - in Blender.

I already thought in the making, the stetch Constraint Bone could cause some trouble … but I don’t have any idea how to fix it.

I hope you can help me!

I would also like to know the answer to this question…

It was a problem in Blender.
The direction of the axis were wrong - you have to modify the roll of your bones and then it works.

Well, in my case ^^