Vector3 zed = other.transform.InverseTransformVector (transform.position - other.transform.position);
zed .x = 0f;
zed .y = 0f;
zed = other.transform.position + other.transform.TransformVector (zed);
I’m using this for grind physics. This takes my player’s position relative to a waypoint, converts it to the waypoint’s local space, removes X and Y then converts it back to world space to get the player’s position between waypoints
I’d like to know if there’s a way to do that that’s not quite so hilariously messy and expensive.