How would I have a 3d widget component inherit bindings for variables from blueprint parents

Good Morning!

I am trying to implement some UI functionality for a card game I’m working on but I’m running into some trouble. I have a parent actor class BP_CardTemplate which has a widget component rendering the card UI in worldspace. From this card template parent there are many children that will make up the different cards in the game. Ideally all cards should inherit from this actor so I can store and reuse the functionality.

I can get a reference to this Card Template in the UI Widget Blueprint and set and bind the variables from there, however all of the children are inheriting the same values, effectively making it so each card is rending the ui for the template card. I’ve been looking online for solutions but I think I’m not asking the right questions to solve my problem. Ultimately I’d like to know how to make a dynamic reference to children card blueprints so I can pull the right variables each time the UI is constructed.

I am very new to code and unreal engine so I’m sorry if I have left out any important information, I’ll be sure to include anything that helps on request.

Thank you, and I’m loving learning Unreal Engine blueprinting!

Are these actually child blueprints, or just instances of the card blueprint with different variable settings?

Can you show some of the internals?

Hello! Thanks for taking the time to help. I believe they are actually child blueprints

Here is the parent card template blueprint class. On construct it runs a function that gets the row from the datatable and sets the variables.

Here is that function:

Here is an example of a card child blueprint that inherits from the card template blueprint:

here is the widget blueprint that is being rendered in worldspace as a widget component that lives on the card template parent and its children.

here is the second part of that blueprint that sets the variables for the ui bindings.

So essentially every card that is spawned right now is taking the form of whatever datatable row is being references on the card template parent blueprint. It won’t grab different info for the child blueprints, so that is what I’d like to fix. Thanks in advance and let me know if there is any other info that would be helpful!

I could be wrong, but I think it’s not possible to have the function that reads the data table in the parent, because you’ll only have to override the function in the child, because the row name is not know until run time.

Would it not be better to make each card an instance of that parent blueprint? It can take the row name from a variable.

EDIT: Another idea, is don’t do the card access in the constructor. The problem with constructor script is it runs before you can set variables. If you transfer that code to a custom event, you can call it after you’ve set the necessary variables…

Is any of this any use?