Hi guys! I found a behavior that I thought it was weird and did find no clues about. If I create a Game Object, add a Sprite Renderer with a Sprite and add a child by Script like this:
private void Awake() {
GameObject child = new GameObject();
child.transform.SetParent(parent.transform);
child.transform.localPosition = Vector3.zero;
}
The position of the child (0,0,0) is set to the Sprite pivot position and not to the parent transform position. I tested using other positions to the pivot. Why this is happening? (Unity version: 2019.3.7f1)
Thank you all in advance.