How to display a sprite if the input length of a lineedit is under 8 characters?

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

I am trying to do a password system where another node will appear if the length of the lineedit has not reached 8 characters.
What i’ve done is:

func _on_Sprite2_text_entered(new_text):
var length = len(new_text)
if length < 8:
	get_node("Sprite1").appear()
else:
	pass 

(sprite 1 is the one I want to appear while sprite 2 is the lineedit).

:bust_in_silhouette: Reply From: rakkarage
    get_node("Sprite1").visible = true
else:
    get_node("Sprite1").visible = false

I tried doing that but nothing would happen. I placed that under the if length < 8:. Is that where it was meant to go? Sorry I’m new at all of this haha

Cakee | 2020-09-06 13:00