I have an object which when it is destroyed it will leave something behind.
//Spawn object at point GameObject bonusDrop = (GameObject)Instantiate(bonusItem,target.transform.position, Quaternion.identity); //Set the transform to the canvas (without this line the position is correct) bonusDrop.transform.SetParent(canvas.transform); //object is completely off - I would like to set it to the canvas as it is intended as a UI element
- The object ends up in the correct position if i dont set the parent (but if I don't set the parent the UI element won't work as intended).
- I would love some help in trying to figure this out. I hate to say it but I feel the solution is simple and I can't get it =(