> For the complete documentation index, see [llms.txt](https://docs.febucci.com/text-animator-unreal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.febucci.com/text-animator-unreal/other/best-practices.md).

# Best Practices

Every project is different, but in this page you can find some common best practices that can help you set up everything better and avoid most common issues!

***

## Extending Plugin C++ Classes&#x20;

To use C++ classes or headers provided by the plugin in your project, add the plugin module as a dependency of your project’s build module.

1. Open your project’s `<ProjectName>.Build.cs` file.
2. Add `"TextAnimatorFebucci"` to `PublicDependencyModuleNames`:

```c++
PublicDependencyModuleNames.AddRange(new string[]
{
    "Core",
    "CoreUObject",
    "Engine",
    "InputCore",
    "TextAnimatorFebucci"  // <-- Add this line
});
```

3. Close Visual Studio.
4. In File Explorer, right-click your project’s `.uproject` file and select **Generate Visual Studio project files**.
5. Reopen the solution in Visual Studio.

You can now include the plugin’s headers in your C++ code. IntelliSense should recognize and suggest the plugin files automatically.

{% hint style="warning" %}
Repeat the project-file generation step whenever you add the plugin module as a new dependency or make changes that affect your project’s module dependencies.
{% endhint %}

## Set the entire text or dialogue only once

Please try to set text just once, and use the typewriter or visibility methods to control how it appears.

{% hint style="info" %}
If you really need to append text later in time, you can use the "AppendText" function found in the core UMG widget `UAnimTextBlock`.
{% endhint %}

If you have a character that says "Helloooo how are you doing?", and you want to display it letter by letter, simply do:&#x20;

`Typewriter->ShowText(FText::FromString("Helloooo how are you doing?"));`&#x20;

and that's it! [Show and hide letters dynamically](/text-animator-unreal/typewriter/show-and-hide-letters-dynamically.md)

If you're building a dynamic string, you can still do that before setting its value to the typewriter/animator.

```cpp
int Apples = 5;
FString PlayerName = TEXT("Bob");

// Build the dialogue string first
FString Dialogue = FString::Printf(TEXT("Hello %s, you've got %d apples"), *PlayerName, Apples);

// Then pass it to ShowText, which expects an FText
Typewriter->ShowText(FText::FromString(Dialogue));
```

(If you're using a Dialogue System, they'll do this for you - no worries ! [Integrations](/text-animator-unreal/integrations/integrated-plugins-and-dialogues-systems.md))

<details open>

<summary>Why should I set the entire text once, instead of character by character?</summary>

Performance! (Not even considering Text Animator)

Every time you set the text, calculations are performed for its mesh, positioning etc. Text Animator then re-calculates character durations and more. This means that if you change it multiple times per second (e.g. adding more letters each frame), you're doing these calculations every single time!

To display characters one by one, you can simply set the full text once, and then start the typewriter: [Show and hide letters dynamically](/text-animator-unreal/typewriter/show-and-hide-letters-dynamically.md)&#x20;

</details>

***

{% hint style="success" %}
If you're changing something in the text editor but it's not getting updated, please let us know!
{% endhint %}
