Hello UnrealEngineers (waw!)
I think, I’ve missed something on jow to add an item in an array (even if I’ve read the unrealengine.com doc).
To stay as simple as possible, in my project I have a level wich is a 3D hub were the player can select in wich level he want to go with his character. Once the level selected, he has to go through a ‘portal’ (a very simple Blueprint with an -OpenLevel- node).
But I want to set an array wich will include all the unlocked levels to not allowed the player to go to a level that he has not unlocked previously. To unlock a Level the player has to collect 3 coins in the first level to unlock the 2nd level…
So here is how I made it:
-Each time the player pick up a coin, here is game happen in GameState:
(By default Unlocked Level contains 1 item)
-Here is how the portal check if the Selected Level is Unlock:
It seems that Level_2 is added when the CoinTest event is called but when an other level is load the array is ‘reset’ to his default value (at least it is what I think after many debugging tries).
Thanks for reading!
PS: Every similarity with the ‘Blueprint Game Framework Basics | Live Training | Unreal Engine’ tutorial video by Alan Noon is purely intentional.