That’s an example from Annoyed Tomatoes. It’s loading the previous sound volume. It checks to see if the user previously set the volume. If the localStorage variable “sv” (which is short for “sound volume”) is greater than or equal to zero, then the user saved the value. If not, then set it to the default value of “8”.

That general idea should be what you need to solve the problem. If there is a player name entered already, then don’t bother asking for it. Otherwise, the player enters their name. The tricky part is checking to see if the name variable is empty. I’m not quite sure about this part, but here’s a guess…

// Load Player Name
if (localStorage.name.length > 0) {
// Welcome back player
} else {
// Who are you player?
}

@Photics is offering an idea of one way to possibly solve your issue, this is an example so it is not going to be exactly what you want. The intension is you adapt the idae to your needs

We could post other examples like using a Global var. within another function but I suspect all this will do is elicit more questions because we are only giving more examples that do not match your project.

One way to help us help you is to post a project with your set up. Can you please post one.

I solve the problem with the help form gasspence. My input-field look like that:
input type=text" id=“name” value=""
Then, in the next step, i set the input-field as a persistent symbol with the choice “add to the current scene”.name2scene.zip (26.3 KB)