i want to load the next level after fulfill certain condition. it works on level blueprint. i want to ask that is i have to check condition in all level and load next level. is there any way to do that only ones and load next next level in one place like game mode. how to access which level/current level running and load next level after complete it.
- In the Game Mode, create a Name Array with the names of all the levels that you have.
- Create a blueprint function called F_Next_Level or something (in a Blueprint Function Library).
- In your level BPs, once all the conditions are fulfilled, call the F_Next_Level function. What the function does is this:
P.S. Just keep in mind that you have to update the array when you add new levels.
instead of writing so much code in blueprint Function Library is not it easy to write just open level in each level. which is better for save time , memory and increase performance. write code in blueprint function library or each level.
Here you do it once, and then you only have to update the array. If you want to change the order of levels, you just drag and drop an array element, and it just works.
If you use Open Level in every level bp and you want to change the order of levels, you’ll have to go to every affected level and change the name manually and waste more time.
As for the performance, it’s a light function that will be executed once at the level-end.
At the end of the day, it’s your decision. Neither memory nor performance will suffer in any case, but you can simplify the workflow for yourself with the function.
thanks for clear my doubt. i am doing self study in lock down.
You have to either connect the Cast node into the function before or after Get Current Level Name, or right click it and Convert to pure cast. In my screenshot it’s converted, so it looks different.
And your target is correct.
thanks it done.