Rotation of parent when child rotating forward

hello guys if anyone have solution for me i will be happy.I have attached compass to my arcamera
this compass have transforms on v3zero and have script for child arrow of compass for facing forward to
direction of target.what i need is when arrow is facing to target and compass is tilted,arrow tilt whit him
with direction which was seted.I trying with quaternions but with bad results.

script:

var targetPos = new Vector3(targetDebug.transform.position.x, arrow.transform.position.y,
targetDebug.transform.position.z);
arrow.transform.LookAt(targetPos);

my hierarchy:

this occur when compass is tilted

facing to target also when target is higher or lower on Yaxis

Update :

Vector3 targetDir = targetDebug.transform.position - arrow.transform.position;
        var parentPivot = arrow.transform.parent.transform.parent.transform;
        var rot = Quaternion.LookRotation(targetDir, Vector3.up);
        var baseRot = parentPivot.rotation;
        arrow.transform.rotation = baseRot * rot;

Working better but its not 100%

OUCH! My head just exploded. Make a reference… nobody should torture code like that!

Also, the above expression is equivalent to arrow.transform.parent.parent

But trust me: make an actual reference. The brain explosion you save will be your own.

If you have more than one or two dots (.) in a single statement, you’re just being mean to yourself.

How to break down hairy lines of code:

http://plbm.com/?p=248

Break it up, practice social distancing in your code, one thing per line please.

“Programming is hard enough without making it harder for ourselves.” - angrypenguin on Unity3D forums

Sorry thats my code under debuging comment if problem will be solved i will rewrite it for future implementation