Hello ,
Please how to know, position of a game object relative to another gameobject without using gameobject relationship, father son,
Thank you very much and good day.
Best regards .
Hello ,
Please how to know, position of a game object relative to another gameobject without using gameobject relationship, father son,
Thank you very much and good day.
Best regards .
With this i receive same value as with relationship:
public class NewBehaviourScript : MonoBehaviour
{
public Transform FirstTransform;
public Transform SecondTransform;
private void Start()
{
Debug.Log("First Relative to Second = " + (FirstTransform.position - SecondTransform.position));
Debug.Log("Second Relative to First = " + (SecondTransform.position - FirstTransform.position));
}
}
Read a bit on Vector math ![]()
Thank you very much
I just forgot the solution ![]()