I need to find the distance of two objects but ignoring the Z axis in the calculation. Normaly I would just do:
Vector3 aV = a.transform.position;
Vector3 bV = b.transform.position;
aV.z = 0f;
bV.z = 0f;
float dist = Vector3.Distance(aV,bV);
But that only works when I want Z to be the WorldSpace Z. My Z should be the local Z of the 2 objects (I make sure in advance that they face the same direction).
Is there maybe already something in Unity that I can use to easily figure that distance out?