# 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])
];
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.oserosuite.com/technical-notes/unreal-engine-notes/slate/set-uobject-delegate-for-tattribute-less-than-t-greater-than.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
