I have a UI Prefab that have rec transform values ( anchors…offset,everything set up)
But when I instantiate a gameobject with this prefab
GameObject object = Instantiate(CardPrefab, CardPrefab.transform.position, CardPrefab.transform.rotation) as GameObject;
It completly reset the rect transform of the object , instead of getting is values, I tryed with
transform.SetParent(content.transform, false);
transform.SetParent(content.transform, true);
transform.parent = content.transform;
But even if it change the offset(even changed, they are different from prefabs) , the anchors, scale , and pivot are still reset
How can I instatiate a gameobject respecting the rectransform of prefab?