I'm adding an object to the parent:
Transform target = Instantiate(_leftTargetPrefab, leftTargetPosition, Quaternion.identity);
target.SetParent(_ballsParent, false);
I'm trying to get the coordinates inside the parent, but they don't match:
Vector3 testPos = _ballsParent.InverseTransformPoint(leftTargetPosition);
Is it possible to find out the coordinates inside the parent without adding an object?
To get the coordinates relative to the parent, you can subtract the coordinates by the parent's world position.
To get the position of a child relative to the parent you can use
transform.localPositioninstead oftransform.position