Hello everyone.
I am working on a project which requires me to store the number of times a certain button inside the scene is clicked in a file on server. I am trying to use “fs” in typescript for this but it keeps telling me that “require is not defined” .
I am still very new to both needle and typescript so I will very much appreciate any help.
Thank you.
Hey, you can not access the filesystem from a clientside script (unless you’re using a PWA or something like it) - what you can do is save information in the browser’s storage. Have a look at Client-side storage - Learn web development | MDN
Another way would be to send that information to the server / backend. If you’re planning to deploy to e.g. glitch using our template you could just save it using the networking API