Create "login" screen and save user data


#21

So as you can see in the code snippet that you pasted, he is only getting the item, so reading it.

To create it, you’d have to do this:

localStorage.setItem('your-item-name', value);

then you can just read it like this:

var savedItem = localStorage.getItem('your-item-name');

#22

Yep :wink:. Just found that line, didn’t scroll down far enough.

EDIT: I think the other part of my problem is I’m not live tracking the values I want in the scene, I’m using console to track them, so every time I refresh the game the values set back to 0 when I try to see them.


#23

i would definitely recommend using local storage its way better then cookies i have a function that u could use that might help
if u want it has all the local storage functions that i know of and a lot of tips too
one more thing id recommend your storage variable names to be very unique as they will be overwritten on other programs with the same keys i normally use
“myusername-programname-variablename”