I know my question is pretty basic, but for the life of me, I can't find any tutorial that explains clearly what I'm looking for, even though it seems it's quite a basic thing to set up ! Lots of forum message boards saying "just create an instance variable to keep track of the UID of instances created" without any more details, and that isn't very helpful to me...
Here is a more detailed breakdown of my problem :
I'd like to be able to differentiate, on runtime, between 4 different instances of an object created at runtime. So that when one of those is selected, the code knows which one was selected and acts accordingly.
To be more specific :
Here is the function that is called : it creates a button that gives the player a dialogue choice (and the parameters allow me to specify the position of each button as well as their text input) :
Then in the event, I'm calling this function as many times as I need dialogue options for the player (here, 2 options) :
But I can't then have the rest of the code follow accordingly to what button the played clicked, since I don't know how to pick those dynamicaly.
I tried a lot of things with UID and all, but I must be doing it wrong since it never works (plus every tutorial I come across isn't tailored to my needs obviously, so it never works when I'm trying to translate it to my project).
You can discard the crossed out section of the code, which is precisely one of my attempts, with an instance variable on the button object, to keep track of the instances' UID (it failed).
Thanks in advance for your help !!