Question by
lxq · Sep 28, 2015 at 06:36 AM ·
instantiatebuttontriggercanvas
Instantiate a canvas with a button when trigger
I'd like to Instantiate a canvas with a button when player enter a trigger. And the button could set other exist obj inactivity.
I save the canvas as a prefab and it has the function to set obj inactivity. Then I write this code:
> void OnTriggerEnter(Collider other){
> if (other.tag == "Player") {
> Instantiate(CanvasBtn); }
It could create the button but its onclock function does not work. Could someone explain it to me? Thank you.
Comment