> For the complete documentation index, see [llms.txt](https://docs.oserosuite.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oserosuite.com/technical-notes/unreal-engine-notes/slate/set-uobject-delegate-for-tattribute-less-than-t-greater-than.md).

# Set UObject Delegate for TAttribute\<T>

By default, TAttribute\<T> can create the following:

* Lambda
* Raw
* SP
* Static

But the UFunction and UObject delegates need extra bullshit.

Either, the TAttribute has to be pre-initialised:

```cpp
TAttribute<T> AttributeDelegate = TAttribute<T>();
AttributeDelegate.BindUObject(this, &UMyObject::MyDelegate);
```

Or, it can be created inline by using the basic “Create” and then a “FGetter”:

```cpp
TAttribute<T>::Create(TAttribute<T>::FGetter::CreateUObject(this, &UMyObject::MyDelegate))
```

Example from Osero Suite: Plugin Sync Tool using TAttribute\<FSlateColor>:

```cpp
SCB_Plugins->AddSlot()
[
  SNew(SButton)
  .Text(FText::FromString(PluginFolders[i]))
  .ButtonColorAndOpacity(TAttribute<FSlateColor>::Create(TAttribute<FSlateColor>::FGetter::CreateUObject(Settings, &UOS_PST_Settings::PluginToSyncColour, PluginFolders[i])))
  .OnClicked_UObject(Settings, &UOS_PST_Settings::ButtonClicked_PluginToSync, PluginFolders[i])
];
```
