transform.localPosition uses local position, in respect to object’s parent, not the world.
But then you use inverse, with Camera absolute transform reference.
So there may be some confusion.
PS. please use script tag for codes.
Instruction ** Using code tags properly **