Replace scene data store

How I can store some data like score, and user info and pass it to another scene because while I replace the scene automatically data got reset. give the solution which run mostly all platforms.

You can use a singleton script to store the data, you can import this script anywhere and access to data

Really straight forward, like

// Data.ts
export const data = {
    a: 0,
    b: "ex"
};

In any other scripts, you can do

import { data } from 'Data';

data.a = 1;
console.log(data.b);
1 Like