Adding labels programatically

I’m generating AddressableAssetGroups and adding AddressableAssetEntrys to them programatically (for UMA). This is generating correctly so far.
But when I go to add a label to the AddressableAssetEntry, it doesn’t appear to do anything. I don’t see it in the UI after the fact.
I’ve tried manually adding a string to the labels property.
I’ve tried using SetLabel(labelstring,true);

SetLabel returns true.

But I don’t actually ever see the label on the AddressableAssetEntry in the “Addressable Groups” editor.

Am I doing something wrong?

Hey @Jaimi try setting the next parameter in SetLabel to true as well. This will force your label to be added to the Addressable Asset Settings label table. So use

myEntry.SetLabel(label, true, true);

I’m not sure if the UI will update automatically or if you’ll need to post the event as well. If you do want to post the label event use

myEntry.SetLabel(label, true, true, true);

the last parameter will tell the system to post an event when a label is added to the label table

Hope that helps!

Perfect, that did it. Thanks!

1 Like