GameObject position not set

Hi, I am trying to set a GameObject in the script. However, no mater how do I change the position of the game object. The actually shown position will not be change in the game. How can I fix it

GameObject itemObject = Instantiate(inventoryItem);
itemObject.GetComponent<Image>().sprite = item.Sprite;
itemObject.transform.position =;  

The GameObject you are using uses a Rect Transform (like other UI objects) instead of a normal Transform. Try itemObject.GetComponent<RectTransform>().localPosition =