World Text
Introduction
Actor used to display text in the world
Components
The WorldText uses the following components:
| Name | Description | Type |
|---|---|---|
| Container | Actor used to display text in the world | USceneComponent* |
| TriggerComponent | The trigger used to activate the text | UBoxComponent* |
| TextWidgetComponent | The text widget responsible for displaying the text | UWidgetComponent* |
API Reference
Properties
| Property | Description | Type | Default Value |
|---|---|---|---|
| WordWidgetClass | The class used to create the word widget | TSubclassOf<UWorldTextWordWidget> | |
| LetterWidgetClass | The class used to create the letter widget | TSubclassOf<UWorldTextLetterWidget> | |
| bIsDisabled | Is the trigger disabled? | bool | false |
| Text | The text that should be displayed | FText | |
| Sound | The sound to play when activating the text | USoundBase* | nullptr |
| bPlaySoundAtActor | Should the audio be played at the actor's location? | bool | false |
| ActivateOnDestroy | An array of world text actors to activate when this text actor is destroyed | TArray<AWorldText*> | |
| EnableOnDestroy | An array of world text actors to enable when this text actor is destroyed | TArray<AWorldText*> |
Functions
| Name | Description | Params | Return |
|---|---|---|---|
| Activate | Activate the text | ||
| CanActorTriggerText | Can the actor trigger the text? | Actor (AActor*) The actor to check |
bool A boolean value indicating if the actor can trigger the text |
Blueprint Usage
You can use the WorldText using Blueprints by adding one of the following nodes:
- Ultimate Starter Kit > Narrative > Activate
- Ultimate Starter Kit > Narrative > Can Actor Trigger Text
C++ Usage
Before you can use the plugin, you first need to enable the plugin in your Build.cs file:
PublicDependencyModuleNames.Add("USK");
The WorldText can now be used in any of your C++ files:
#include "USK/Narrative/WorldText.h"
void ATestActor::Test()
{
// WorldText is a pointer to the AWorldText
WorldText->Activate();
bool CanActorTriggerTextValue = WorldText->CanActorTriggerText(Actor);
}