I have a state linecasting between two objects to get the distance (among other things) and although the debug line is showing correctly in scene, the distance is coming out at about 0.95 which is manifestly wrong. To test, I debugged with a getdistance action, which measures to the object centre, and so will be different value, but not too far out in this particular case. It gives the distance as over 290, which is clearly the right ballpark.
I have debugged the linecast, so I know it is hitting the right object. I have it set up with a layer mask which currently holds only four objects in the scene, and the other three are well out of the way. (Edit: this is a 2d set up btw.)
What am I not getting?
Edit: To test, I made the hit object enormous, so that the distance to the hit point was about half the distance to the hitobject's centre and the hit distance came out as around a half. Is this how it's supposed to work then? The hit distance returned by the linecast2d is the ratio of the distance from the linecast start and hit point to the distance between the two object centres? i.e.:
(distance between linecast start point and hit point) divided by (distance between linecast start point and hit object's centre)
If so, that's okay, but it's very unintuitive, especially as it isn't described as such in either Playmaker or Unity docs.