How to make automatic change of camera position from Static mesh?

Read the largest component of the vector and apply it to the springarm length: