Ivalid call .nonexsistant function "clear" in base string.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By TLehtonen

Sorry if this is a stupid question ,but I am very new to GD script (started it 3 days ago) and basically it shows me this: Ivalid call .nonexsistant function “clear” in base string

func _on_PlayerText_text_entered(new_text):
$VBoxContainer/TextDisplay.text = new_text
$VBoxContainer/PlayerText.text. clear()

:bust_in_silhouette: Reply From: Zylann

The text property is of type String. Strings don’t have a clear() function. If you want to erase text in PlayerText, you can set it to an empty string instead:

$VBoxContainer/PlayerText.text = ""