1 decade ago by rootbeerking
Hello, this will probably be a very easy question to solve, so forgive me for asking. I'm working on getting my player to respawn after dying. Currently I'm doing this by using
This works fine, but the issue is that this would only work for one particular level. I was wondering how I would make it so that depending on what level the player died in would be the level that is reset.
I take it I would somehow have to assign a variable whenever a level is loaded and then use something like:
But I'm not sure how to do that exactly. Any help would be much appreciated, as always.
Thank you very much for taking the time to help me.
ig.game.loadLevelDeferred( LevelTest );
This works fine, but the issue is that this would only work for one particular level. I was wondering how I would make it so that depending on what level the player died in would be the level that is reset.
I take it I would somehow have to assign a variable whenever a level is loaded and then use something like:
ig.game.loadLevelDeferred( this.currentLevel );
But I'm not sure how to do that exactly. Any help would be much appreciated, as always.
Thank you very much for taking the time to help me.