Question by
levjackie14 · Feb 14, 2016 at 03:57 AM ·
c#ui image
Instantiate UI prefab
I am trying to Instantiate an object onto the canvas but when I run my code nothing happens. I think the problem is with the SetParent method. but I could not find anything. Thank you.
dropSmallApple = (GameObject)Instantiate (fractional_apple, ShootPtAnswer.transform.position, Projectile_pos.transform.rotation);
dropSmallApple.transform.SetParent (this.transform, false);
screen-shot-2016-02-13-at-105023-pm.png
(59.5 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612064127im_/https://answers.unity.com/themes/thub/images/avi.jpg)