Changing only some nested data sources and data source paths in templates?

Hey there had another possibly super simple UI Builder question; is there a way to change data source paths from Templates?

For example if I had a nested text field (nested deep enough in the hierarchy that I can’t change it) that just displays the players health, I’d like to duplicate this template and then just set it’s data source path to stamina or something. Let’s also assume this template contains the characters name or something, which is in a different data source type altogether-

So the structure of the template may be something like this

  • TemplateBase
    • ContainerDiv
      • Name (PlayerInfo as Data Source Type)
    • ContainerDiv
      • Number (unset data source)

And the structure of the UI document containing said template may be:

  • TemplateBase Instance
    • ContainerDiv
      • Name (PlayerInfo as Data Source Type)
    • ContainerDiv
      • Number (PlayerStats as Data Source Type)
  • TemplateBase Instance
    • ContainerDiv
      • Name (PlayerSomethingElse as Data Source Type)
    • ContainerDiv
      • Number (unset data source)

How could I achieve this? I’d rather avoid code for this for a myriad of reasons but namely just hoping this is something I can natively handle in the UI Builder I may be missing, but if it can’t be avoided it can’t be avoided :person_shrugging:

Hey!
Attribute Overrides can be used for this, but there seems to be an issue in the UI Builder where those attributes are disabled when they shouldn’t. Can you open a bug about this?

At the moment, the attribute overrides for the data-source and data-source-path needs to be set in the uxml file manually.

Hope this helps!

Wait, I’m a bit lost, there’s a bug? On my end? What should I be seeing/what am I missing?

So if I wanted, say, a UXML for use with the editor for previewing Vector2 values in a specific way (with plans for using it for multiple values across multiple scripts), I’d have to set those source paths manually each time? Hmm, I think I have an idea to work around it then; I could separate the Vector2D parts from the Name/label div and just do some smart CSS to overlay them as needed.

I think this solves another issue I had too :slight_smile:

Follow-up question, let’s say I have this again:

  • TemplateBase
    • ContainerDiv
      • Name
    • ContainerDiv
      • Number

as a template, and I want to add an attribute to this template’s base, that will control the color of the ContainerDiv > Number’s color. How could I achieve that? (The documentation can honestly be a bit obtuse regarding this and I’m having a hard time sifting through it all)