> For the complete documentation index, see [llms.txt](https://fast-studios.gitbook.io/press-e/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fast-studios.gitbook.io/press-e/manual/scripting/ui-prefab/uiprefab.setinteractiontext.md).

# UIPrefab.SetInteractionText

<mark style="color:blue;">public void</mark> <mark style="color:yellow;">SetInteractionText</mark>(<mark style="color:blue;">string</mark> <mark style="color:$primary;">enabled</mark>, <mark style="color:$success;">Interactable</mark> <mark style="color:$primary;">interactable</mark> = <mark style="color:blue;">null</mark>)

Use this method whenever you need to change the **interaction text** on a **UI Prefab**.\
It parses the input and replaces the following tokens:

* `{key}` or `{interactionKey}` → shows the current **interaction key**
* `{throwKey}` → shows the current **throw key**

```csharp
public Interactable interactable;
public UIPrefab uiPrefab;

public void ShowGoodUIText()
{
    // If the text is generic (not tied to a specific interactable),
    // it will resolve {key}/{interactionKey} using the manager's key.
    uiPrefab.SetInteractionText("Press{key} to interact");
    // Output: "PressE to interact"
    
    // If the text may depend on an override (e.g., a different interaction key),
    // pass the interactable so the system can check for overrides
    uiPrefab.SetInteractionText("Press {key} to interact", interactable);
    // Output: "Press Q to interact"
    
    // Throw key replacement:
    uiPrefab.SetInteractionText("Press {throwKey} to throw")
    // Output: "Press F to throw"
}
```
