UI button click to trigger functions in multiple instances
I have an imported model from Maya but it is only a simple plane with an alpha cutout material applied. (It's a corn plant.) I made 3 animations on it in Unity and got the state machine set up for it. Then I created a couple UI buttons for me to trigger the animation transitions. I got it all working on one corn plant. Then I duplicated that plant 76 times around a field. The only way I can see to have the same UI buttons trigger the animations in all the corn plants is to have 76 button click events in each of the buttons, one for each instance of the corn plant. Is there an easier way to do this?
Your answer
![](https://koobas.hobune.stream/wayback/20220612092524im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Instances of the client 1 Answer
Create 2 seperate instances of the same prefab,create 2 Separate instances of the same prefab 0 Answers
My goal is to have multiple enemy prefabs with the same script and call their script. 1 Answer
C# Use Multiple instances of Script or For Loop Once 1 Answer
Buttons won't get interaction in instantiated prefab 0 Answers