but, when the room is over i start the same scene using diferent data with
this.scene.start(this.key, { id: 3});
And the scene restart correctly, but with the same data that the first time. In my case the data is an Id that switchs between the TileMaps to use. And when the scene restarts, all the parameters restart and I can play the Game again, but with the same map.
PD: Sorry I don´t know how to copy code in the correct format
Hi @DavidGanfornina! I have a really good example that I can’t share because it’s client work. However, what you want pretty much works well for me. For a demo-game, I had one scene that would load different levels with tilemaps depending on the data that was passed. It restarted the entire game after completing the last level:
You can have the same logic in init() as well. Also note that if you’re restarting the current scene, you can omit the key property. I’d say use a debugger to see if the key is correct and watch values for this.id. Maybe it’s being reset somewhere else?
Try logging values at every point. It sounds like what you’re doing should work.
Be careful that you’re not using the same asset key in preload with a different asset URL. Use different keys or else remove the original asset first before reusing the key.