Hi, thanks for your time and efforts.
I followed this tutorial and built a clickable list in blueprint. I have it so it’s a list widget within another UI widget. I’m trying to associate characters to each button so that when the button is clicked, the camera pans over to that character. I’m having difficulty finding a way to store/retrieve an object reference associated with the buttons, and therefore unable to “point” to the character that I need to obtain the location of. Where and how would a reference to a character be stored? In the ListEntry?
you can store data in the class you’re using for the item.
if that’s not possible, you can try to reference them by index instead.
i would usually refer them by index anyway.
Thanks for the reply. I haven’t tried to store the object reference in the list widget yet, as I’m not certain how I should go about doing it. I have arrays in the player controller, but then get the dependency cycle error.
that code does not make a lot of sense to be honest.
i was suggesting to store the index in whatever item is stored in the view.
so that when the “OnClicked” Event is triggered, you can access that value directly.
as an example, i have a button with an id field, that i use for this purpose.
when i create the button i set the id to whatever value it needs to be.
Yes, I’d like to store the index in the button. Question then is how would I do that with blueprints and the list I have already set up. I forget if there’s a way to send the object reference to the button.
make your own class of a button, or the item in the list.
make sure to choose the right parent.
then add a variable for the index in such class.