Do you have a gamemode BP or something else that holds the logic for the player respawn? can we see that please? assuming when the player dies you are respawning their pawn and having them posses the new one? when the pawn is respawned the event BeginPlay is triggered for the new BP instance.
I wanna know how to implement a variable which changes that my level sequencer is not looping anymore when has played at the beginning of my level. This sequencer is an introduction of the level and it’s annoying every time character dies and the level sequencer is looping again. I know it’s not hard to implement but i can’t figure out how to do it. Thanks.
Yes, i have a gamemode instance that resets everything when character dies. Also, i have a variable called “SequenceHasPlayed” at the end of the blueprint logic. Certainly, after BeginPlay should it have a boolean saying if level sequence is playing or not. I did that but nothing happens.
Even though you have a Boolean your setting as Sequence Has Played, it doesn’t look like your using it at all during event begin play. I would recommend adding in a branch just before the play button as indicated here. On false, continue to play, on True, depending if you want the animation montage before the widget creation or not connect the execution line to that.
I’ve done what you explained to me. But if i use on branch, false continue to play, and true connect to widget, the level sequence won’t play. Instead, if i do it with reversed conditions the level sequence is playing but f i dead again, we have a looping.
So you will need to ‘drive’ the branch Boolean pin with the variable value your storing in your game mode. checking or unchecking the box as you have it is the equivalent of hard coding an If statement to if(true){} or if(false){}. as such there’s no dynamic activity.
Since you said your storing your data in the game mode I’ve pictured here the basic setup then to grab this information. any blueprint has access to the Get Game Mode node, and you will use this to cast to your specific version the level is using, in my case its FirstPersonGameMode, so whatever you’ve named yours. The next step is to grab the variable value (get Has Run Sequencer) and plug that into the branch. assuming the game mode value is properly updated and changed you should see what your desiring.
Still not works. I guess the GameInstance or GameMode are resetting variables every time i die. This issue is more bigger than we thought. Here i show you my gameinstance, maybe i’m using a wrong idea to do what i want and also i’m using a framework deducing his own logic it should be wrong.
Fair enough, lets try this then. Since this is a one time sequence you want to play right at the beginning, have the game mode play it on event begin play. you can even grab the player controller and disable inputs and such there. Here is a quick example setup I made, the sequence variable is a level sequence that just moves a block around briefly. All of this is being run in the gamemode.