Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | AndrewAndrew |
Hello, I have a question!
I have two scenes - CharacterCreation.tscn and Game.tscn
In CharacterCreation.tscn I have a LineEdit for input nickname, there is it’s code:
extends LineEdit
var Name = “PLAYER”
func _ready() → void:
grab_focus()
connect(“text_entered”, self, “_on_text_entered”)
func _on_NameInput_text_entered(new_text):
Name = new_text
I send this script in autoloading and name it - PlayerNameNODE
In Game.tscn I have a label and there must be player name:
func _ready():
print("Your name is - ", PlayerNameNODE.Name)
But when I’m trying to get varibale from script it takes name from this string
var Name = “PLAYER”
So the name always is “PLAYER”, no matter what actual player input.