- Home /
How to add an OnClickEvent on a Prefab?
I am a complete beginner so sorry if my question is stupid. I have a prefab in my scene and I want some dialogue to pop up on the screen when I click on that prefab. I don't understand how to make my dialogue panel pop up when I click on the prefab. I have the dialogue trigger code but how do I add the onclick event? I only did that on a Canvas before, adding the onclick event on the button in the Canvas by calling a function from my code, which was attached to that button. How do I do the same thing with the prefab? Is there a code that can trigger my dialogue panel when I get close to my prefab? I have no idea how to write something like that so some direct suggestions would be really useful (I use C#).
Thank you for your patience!
Answer by PersianKiller · Jul 28, 2019 at 02:18 AM
watch this,it might help you :)
Link-only answers are not useful for future reference because the link may "die". Ins$$anonymous$$d, describe what to do.